Bug 513587 - The selection is displayed wrong with Dynamic word wrap and whitespace in front of the line.
Summary: The selection is displayed wrong with Dynamic word wrap and whitespace in fro...
Status: REPORTED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.21.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-12-19 20:18 UTC by Ondřej Mach
Modified: 2025-12-19 20:18 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ondřej Mach 2025-12-19 20:18:27 UTC
SUMMARY
Suppose you have a long line in Kate with Dynamic word wrap turned on. Then, you add some whitespace in front of that line. When you select the text on that line, the selection 'highlighting' is displayed to the left of the actual text. The issue is only that the selection shows wrong - when you hit Ctrl+X, the correct text disappears. This bug appears in both Kate and KWrite.

STEPS TO REPRODUCE
1. Start Kate and turn on 'View > Word wrap > Dynamic word wrap'
2. Write a long one-line text spanning at least 3 wrapped lines (the first and the last line are not affected)
3. Write some spaces in front of the long line (both spaces and tabs work)
4. Select the whole text

OBSERVED RESULT
The selection highlighting is shifted to the left on all lines except the first and the last.

EXPECTED RESULT
The selection highlighting should be aligned with the selected text.

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 43
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.21.0
Qt Version: 6.10.1