Summary: When scrolled with a touchpad, Kate doesn't do smooth pixel-by-pixel scrolling; it goes one line at a time. Steps to reproduce: 1. Get a laptop and install a Linux distro + KDE + Kate on it (I'm using openSUSE Tumbleweed with KDE Plasma 5.9.4 and Kate 16.12.3) 2. Create or open a long file/document in Kate 3. Use your touchpad to do a two-finger scroll to move to a new location in the document Expected results: The document scrolls pixel-by-pixel according to the movement of my finger, matching the way most other programs scroll (Gedit, Chromium, Firefox, Amarok). Actual results: The document scrolls one line at a time, producing a jumpy and jarring scroll experience--especially when encountering multi-line strings, which make the document scroll much more than expected.
Hi, I too would very much appreciate for both kate and konsole to do pixel-by-pixel scrolling. Kate has been the best editor I've used and whilst it has much more features than Gedit its more uncomfortable to use with large files where you need to quickly and accurately scroll between lines. There's no reason to be stuck in the 90's. If not by default, make it an option, like with most KDE programs. Thanks
I've spoken to Kate developers and they don't object. It's just a matter of doing it. I've taken a look but my C++ skills are probably not advanced enough yet. At some point, if nobody else does first, I'll return to tackle this.
I looked into QPlainTextEdit which is what kate/konsole use and unfortunately its been written with the assumption the Y position is always going to be an integer. It would probably require a complete rewrite. Maybe a better idea is to change QPlainTextEdit for some other widged.
The class documentation says: "QPlainTextEdit is a thin class, implemented by using most of the technology that is behind QTextEdit and QTextDocument. Its performance benefits over QTextEdit stem mostly from using a different and simplified text layout called QPlainTextDocumentLayout on the text document (see QTextDocument::setDocumentLayout()). The plain text document layout does not support tables nor embedded frames, and replaces a pixel-exact height calculation with a line-by-line respectively paragraph-by-paragraph scrolling approach." http://doc.qt.io/qt-5.9/qplaintextedit.html This suggests two options: 1. Suggest to the Qt folks that they re-architect QPlainTextEdit to support optional pixel-by-pixel scrolling while retaining as many of the performance benefits of the status quo as possible. This seems unlikely, but I have submitted an upstream bug report anyway: https://bugreports.qt.io/browse/QTBUG-63241 2. Change Kate and Konsole to use the QTextEdit class (which supports smooth pixel-by-pixel scrolling) and live with whatever performance penalty this imposes. We would definitely need to test with huge documents and lousy hardware to see at what point the performance penalty becomes noticeable, and decide if we can live with that. This seems like what we should focus on in the short to medium term, and make sure we test thoroughly to make sure the performance hit is either negligible or acceptable. Another consideration: if we wait for the Qt bug to be resolved (if it ever is), then we will have to wait before we can turn pixel scrolling until the version of QT that supports it is released and widely available, which may be quite a long time (if ever).
Neither Kate nor Konsole uses QPlainTextEdit or QTextEdit. Both use a custom widget, tailored to the specific use case.
To clarify: They cannot use Qt classes, because of multiple limitations. Reverting description accordingly.
Related to this ancient bug I filed roughly 8 years ago! https://bugs.kde.org/show_bug.cgi?id=256561
Yep, duplicate of Bug 256561. Really hoping to get this fixed... *** This bug has been marked as a duplicate of bug 256561 ***
Unmarking as a duplicate of Bug 256561 because there's a patch that fixes that, but not this. This will have to be fixed separately.
This is a nice wish, but so far nobody did step up to implement it for 5 years and longer. If somebody wants to have this happen, please step up to provide a patch: https://kate-editor.org/post/2020/2020-07-18-contributing-via-gitlab-merge-requests/