Bug 474551

Summary: Whitespace indicator shows wrong when using right-to-left scripts.
Product: [Applications] kate Reporter: demorphism
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: demorphism
Priority: NOR    
Version First Reported In: 22.12.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Picture of bug

Description demorphism 2023-09-15 13:19:40 UTC
Created attachment 161635 [details]
Picture of bug

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
RTL: Right-to-Left, LTR: Left-to-Right

STEPS TO REPRODUCE
Bug1. Use RTL script with spaces. (Such as Arabic, Hebrew, Punjabi)(example: ال ال)
Bug2. Insert an Arabic phrase with spaces inside it in a LTR sentence.(example: a ال ال a)

OBSERVED RESULT
Bug1. No whitespace indicator is seen.
Bug2. The whitespace indicator in the Arabic phrase is shown right of it's cursor position. (see attached picture) 

EXPECTED RESULT
Bug1. Whitespace indicator is seen.
Bug2. The whitespace indicator in the Arabic phrase is shown left of it's cursor position. (see attached picture) 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 23.04
(available in About System)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2023-09-16 15:04:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/599
Comment 2 Christoph Cullmann 2023-09-17 11:44:09 UTC
Git commit 92a4f9323b2a98104802fea12c30dcabfcd0d8fc by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 17/09/2023 at 13:39.
Pushed by cullmann into branch 'master'.

Fix spaces not visualized in rtl text

M  +7    -2    src/render/katerenderer.cpp

https://invent.kde.org/frameworks/ktexteditor/-/commit/92a4f9323b2a98104802fea12c30dcabfcd0d8fc
Comment 3 Christoph Cullmann 2023-09-17 11:44:18 UTC
Git commit ddbb49db25c0ab0d4f4418e139f2bf3c74683965 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 17/09/2023 at 13:39.
Pushed by cullmann into branch 'master'.

Fix space painted over text in bidirection text lines

Checks the previous char's direction and adjusts the x offset accordingly

M  +23   -12   src/render/katerenderer.cpp
M  +1    -1    src/render/katerenderer.h

https://invent.kde.org/frameworks/ktexteditor/-/commit/ddbb49db25c0ab0d4f4418e139f2bf3c74683965