Created attachment 172886 [details] screenshot of issue with large window size SUMMARY This is a follow up to Bug 492062 by request, since part of the issue described in that bug (incorrect hard wrapping) was fixed. The LSP plugin popup seems to use some sizing logic where the maximum allowed width of the box is something like 100px + 40% of textarea size. (I haven't looked at the code for that, it's just based on observation.) This doesn't work well for some documentation. As I showed in the previous report, even a Kate window with width 1778 px and *no* side panels open is insufficient to show a mere 72 columns of Rust documentation, and as a result the LSP plugin adds a horizontal scrollbar. Horizontal scrolling is really bad UX for several reasons: it requires continuously scrolling in two different directions for every line of text, in order to read it; and it tends to react badly when scrolling down on a touchpad because it's difficult to avoid scrolling slightly to the right or left. I have several proposals for improving this situation, which I'll give after the reproduction steps below. STEPS TO REPRODUCE 1. Open a Kate window to a large size, e.g. 1778 pixels wide. I'm using a size 13 font, for what it's worth. 2. Open some Rust code with the rust-analyzer support enabled for LSP plugin. 3. Hover over a `String` object from the rust std library. OBSERVED RESULT The hover box has a horizontal scrollbar. EXPECTED RESULT Three possible solutions: 1. Simply make the box a little bit bigger! As you can see in the screenshot, it's using a pretty small portion of my screen. I see no good reason not to allow the box to be e.g. 60% of the textarea width. 2. Change the text size in the popup box to be slightly smaller than the normal text size in the code editor widget, or allow this to be done through a setting. 3. If all else fails and the text doesn't fit, prefer soft wrapping it to inserting a scrollbar. Because scrolling is really bad UX, soft wrapping is to be preferred even if this might make code examples shown in the popup box technically invalid if you typed them in literally (but copy / paste out of the box would still work!). I think _all three_ of these changes are desirable in their own right, and implementing any of them individually would greatly improve the issue of long text lines in the language server output. SOFTWARE/OS VERSIONS Operating System: Arch Linux KDE Plasma Version: 6.1.4 KDE Frameworks Version: 6.5.0 Qt Version: 6.7.2 Kernel Version: 6.10.5-arch1-1 (64-bit) Graphics Platform: Wayland
Git commit 99744926e2ac2120a31b6d349245974787a59ff4 by Waqar Ahmed. Committed on 19/10/2024 at 20:14. Pushed by waqar into branch 'master'. Allow word wrapping and fix font in tooltip - Make word wrapping work in tooltip. This was mostly fixing the codeblocks so that they can wrap. Qt makes them non-breakable. - Use the editor font in code blocks. Qt uses the default system mono font, which looks crappy on windows especially - Use window width when calculating size, this allows tooltip to be wide even if the view is not as wide M +34 -6 apps/lib/texthint/tooltip.cpp https://invent.kde.org/utilities/kate/-/commit/99744926e2ac2120a31b6d349245974787a59ff4