Bug 342322 - bidi text with parentheses enclosing Hebrew: both parentheses face the same direction
Summary: bidi text with parentheses enclosing Hebrew: both parentheses face the same d...
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: Vi Input Mode (show other bugs)
Version: 16.04.1
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-30 01:22 UTC by phma
Modified: 2020-12-25 15:43 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Sample text which shows the bug. (611 bytes, text/plain)
2014-12-30 01:24 UTC, phma
Details
Screenshot of Kate showing the above file (155.40 KB, image/png)
2014-12-30 01:26 UTC, phma
Details
Screenshot from 16.04.2 (31.50 KB, image/png)
2016-06-21 17:39 UTC, Buovjaga
Details
Screenshot from 20.08.1 (windows) in comparison to Firefox rendering (90.35 KB, image/png)
2020-12-25 14:54 UTC, Jan Paul Batrina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description phma 2014-12-30 01:22:51 UTC
Using capital letters to represent right-to-left text, the bidirectional text is:
parsha 21 is YOU COUNT (THE HEADS OF ISRAELITES); this is COUNTING (THE HEADS OF GERSHONITES)
expected rendering:
parsha 21 is (SETILEARSI FO SDAEH EHT) TNUOC UOY; this is (SETINOHSREG FO SDAEH EHT) GNITNUOC
actual rendering:
parsha 21 is SETILEARSI FO SDAEH EHT) TNUOC UOY); this is SETINOHSREG FO SDAEH EHT) GNITNUOC)
As the text between the parentheses is entirely in Hebrew, this shouldn't happen, but even with bidirectional embedding characters, it does. (I hope those characters are right. I inserted them as bytes using okteta.)

Note that two lines have wrong parentheses )like this(. I was unaware that the Hebrew keyboard layout has 0x28 on shift-0 and 0x29 on shift-9. I duplicated the lines and fixed them in the other two lines.

The text is a comment I inserted at parsha 35 in a translation of the Bible into Lojban.

Reproducible: Always

Steps to Reproduce:
1. Type some text in left-to-right alphabet, then a left parenthesis.
2. Switch to the Hebrew layout and type some text.
3. Switch back to Latin/Cyrillic/Greek/autc. and type more text.
4. Insert a Hebrew word before the parenthesis.

Actual Results:  
Before step 4, the opening parenthesis is on the left, facing right, and the closing parenthesis is on the right, facing left. After step 4, the opening parenthesis is where the closing parenthesis was, facing left, and the closing parenthesis jumped past the inserted word, which is right of the words in parentheses, and is also facing left.

Putting the cursor on one parenthesis correctly highlights both, even though they are facing the same direction.

Expected Results:  
Before step 4, the opening parenthesis is on the right, facing left, and the closing parenthesis is on the left, facing right (indistinguishable from the actual, unless you highlight one parenthesis). After step 4, the parentheses have not moved, and the inserted word is right of the words in parentheses.

Kate version is 3.13.3, not 3.13.2.
Comment 1 phma 2014-12-30 01:24:58 UTC
Created attachment 90164 [details]
Sample text which shows the bug.
Comment 2 phma 2014-12-30 01:26:41 UTC
Created attachment 90165 [details]
Screenshot of Kate showing the above file
Comment 3 Buovjaga 2016-06-21 17:39:38 UTC
Created attachment 99646 [details]
Screenshot from 16.04.2

I get a different, but still messed up result.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.22.0
Qt 5.6.1
xcb wm
Comment 4 Jan Paul Batrina 2020-12-25 14:54:20 UTC
Created attachment 134324 [details]
Screenshot from 20.08.1 (windows) in comparison to Firefox rendering
Comment 5 Jan Paul Batrina 2020-12-25 14:55:58 UTC
I think this has been fixed (not sure from which version, at the very least it is fixed in version 20.08.1)

My only point of comparison is the rendering from firefox, so feel free to reopen if more examples come up that exhibit the wrong behavior.