Bug 480742 - Indentation doesn't work correctly with long continuous lines
Summary: Indentation doesn't work correctly with long continuous lines
Status: REPORTED
Alias: None
Product: kate
Classification: Applications
Component: indentation (show other bugs)
Version: 23.08.4
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-02 16:50 UTC by Alberto Salvia Novella
Modified: 2024-10-24 13:57 UTC (History)
2 users (show)

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


Attachments
bad-indent.sh (203 bytes, application/x-shellscript)
2024-02-02 16:50 UTC, Alberto Salvia Novella
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Salvia Novella 2024-02-02 16:50:48 UTC
Created attachment 165478 [details]
bad-indent.sh

When a line has no spaces and exceeds the window width, an extra newline is created above it, which is wrong.

See the attachment.
Comment 1 Audrey Meyer 2024-07-19 22:44:09 UTC
I can reproduce this in 24.05.2, it's specifically an issue with text wrapping when using tabulator indentation. Text wrapping works as expected when using spaces for indentation.

General steps to reproduce:
1. Type a continuous sequence of letters (no spaces) longer than the window width, so it wraps to the next line.
2. Indent the line you just typed, using tabulator mode.

Expected result:
The indented text is displayed starting on the first line.

Observed result:
The line is wrapped so the text starts on the second line, with the first line only containing the tab.
Comment 2 Waqar Ahmed 2024-10-22 05:14:02 UTC
I am not sure we can do much about it, we use Qt for line wrapping.
Comment 3 Alberto Salvia Novella 2024-10-22 07:15:30 UTC
I would decide if it is solvable in Kate, or if it needs to be notified to Qt.
Comment 4 Waqar Ahmed 2024-10-22 08:10:23 UTC
Enable the following setting in Appearance tab: 

"Disregard word boundaries for dynamic wrapping" 

It will fix the issue.
Comment 5 Alberto Salvia Novella 2024-10-22 08:48:55 UTC
If you enable that setting, words will be wrapped at any given point. Hence it doesn't really solve the problem.

The expected result is:
- Taking into account word boundaries.
- Not creating an extra newline when there is no word boundary.
Comment 6 Waqar Ahmed 2024-10-22 09:01:33 UTC
Then report it to qt. We can't do anything about it. We just use the apis that are given to us.
Comment 7 Alberto Salvia Novella 2024-10-23 19:06:15 UTC
Reported as: https://bugreports.qt.io/browse/QTBUG-130482
Comment 8 Alberto Salvia Novella 2024-10-24 13:57:41 UTC
Qt is asking me how this is implemented in Kate, which I'm not aware of.

Please join the conversation upstream, and then change status back to "resolved: upstream".