Priority: P2: Important
Affects Version/s: 5.11.1
Fix Version/s: None
Component/s: GUI: Text handling
When a text edit (ex. QTextEdit or TextEdit) contains mixed LTR and RTL multiline text, the selection get courrputed for any text that wraps and it's direction is not the same as the base direction.
For example, supposing capital letters are Arabic text:
This is ARABIC text THAT
WRAPS HERE reaching
to the THIRD LINE but
stops wrapping HERE.
Base direction: LTR.
Arabic text that wraps: "THAT WRAPS HERE" -> Issue with selection
Arabic text that doesn't wrap: "THIRD LINE" -> No issues with selection
I have attached an old UI file that I created to test several cases, thinking that the issue happens with the lines except the last one, and the text (direction = base direction) in the first line, but that wasn't general enough. More invistigation leaded to what I wrote above.
I have attached also a video for the selection problem. Sorry that the cursor doesn't show.
The problem actually is that when you click somewhere, the I cursor is rendered in the letter itself, or offseted from the correct location. Clicking and moving the mouse will select strange letters, depending on the font and how complex it is.
This issue affects Kate as well, which uses QTextLayout.