Bug 432325 - kate scrollbar doesn't take into account line length
Summary: kate scrollbar doesn't take into account line length
Status: RESOLVED INTENTIONAL
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 20.12.0
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 453912 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-01-30 22:03 UTC by David
Modified: 2024-03-15 20:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David 2021-01-30 22:03:20 UTC
SUMMARY
When opening a file with very long lines which would span multiple screens if shown with soft-wrap, kate will still show its scrollbar line-by-line, which is not reflective of the length of the contents when the lines have differing lengths and makes it very hard to scroll if there are only a couple lines but they are very long.

STEPS TO REPRODUCE
1. Configure Kate to have the equivalent of "soft-wrap" - i.e. so that long lines would not create a horizontal scroll, but would rather be shown spanning multiple lines inside kate. Optionally set the scrollbar to show text previews.
2. Open some file with very long lines but having < 20 lines or so.
3. Look at the scrollbar at the right. Try to scroll.

OBSERVED RESULT
The scrollbar is not helpful since it will move by lines and show itself by lines - i.e. will be very small, despite the document potentially spanning multiple screens with its limited amount of lines.

EXPECTED RESULT
The scrollbar should reflect line length too, like sublime does.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Dominik Haumann 2021-02-02 02:27:32 UTC
Unfortunately that is by design.

If we want to support that, then Kate would have to layout all lines in the document to know exactly how many wrapped lines are in the view.

Layouting all lines can be really slow since Kate supports right-to-left languages as well. We already have issues about Kate being slow for very long lines. Adding support for this behavior would make it worse.

The only possible workaround would be that Kate knows it has only ascii content (special case), since then with a fixed font we'd know exactly how long a line would really be.

Currently, we always decided to not add such a special case... So we have to live with it.

Scrolling with the mouse wheel should work, though.
Comment 2 Christoph Cullmann 2021-06-12 21:17:56 UTC
Yes, that is by design.
One can keep this as some wish to alter this behavior, but this is unlikely to happen.
Comment 3 Waqar Ahmed 2023-03-24 10:26:31 UTC
*** Bug 453912 has been marked as a duplicate of this bug. ***
Comment 4 Christoph Cullmann 2024-03-15 20:10:29 UTC
Not implemented, if somebody wants to have that, please submit a patch.

So far there was no interest to implement that for years.

https://kate-editor.org/join-us/