Selection and highlighting out-of-sync in Kate at times?


I apologize if this type of question is not what is meant by “Get help for any application in the Manjaro repos here.” and I’ll delete it if it does not belong here.

This happens to me regularly and I thought it had to do with the size of my script but I see, now, it happens on documents under 2000 lines also.

In the screen shot below, I selected (via the mouse) the text "playlist":[] on the first row, which is highlighted in yellow on the following three rows. However, the blue highlighting that indicates what is being selected is several characters to the right. A copy and paste of the selection pastes the correct text, not that under the blue highlight.


My question is, Am I doing something wrong or is this just a minor issue in Kate?

It’s a Tcl/Tk script. (I don’t recall if it has happened only in Tcl/Tk) and it seems to start by pressing the End key to move to the end of the current line and then using the mouse to select some text .

Thank you.

This seems to be an issue with either the font style or the theme. Try to set more common/default theme and/or font on either Kate or KDE. Then test it. If the problem goes away then customize it with different options.

I think this may be the issue because I had a similar issue in the past, affecting only some KDE applications, and the problem was the font (if I recall properly), but I know there are some themes which also cause problems.

Thank you for the response. Perhaps that has something to do with it.

I didn’t notice until now that it isn’t really the moving to the end of a line that starts it off, it is scrolling horizontally to the right by any amount. Text can be selected and highlighted correctly on the same line when scrolled all the way to the left but will become out-of-sync when scrolled any distance to the right; and it appears that the distance it is off is proportional to the distance scrolled.

I split the screen vertically into a left and right side and sometimes work in the same script in both panes. Mostly, I keep each code line short enough to remain within the view of the pane without the need for scrolling horizontally. The portion of the line in the image is part of an insert into a database file; so, I left it a continuous line of SQL.

I think that is why the issue appeared intermittent to me, that is, because most of the lines in my scripts require no horizontal scrolling or there was no scrolling when text was selected.

Whether or not horizontal scrolling affects the highlighting range only for certain fonts and/or themes, is something I haven’t tested out across many themes; but, if I select a standard theme and a Notos Mono font, the behavior remains the same. The selected text is highlighted correctly when the horizontal scroll position is zero and off when greater than zero.

I use auto line break (or dynamic line break), so I never scroll horizontally, but I just tested disabling it and I can’t reproduce the problem.

Thanks. I don’t know the answer; but, after this update to Plasma 6, I cannot reproduce it either. Perhaps, it requires some period of use or a set of steps to trigger it.

I may have been logged on a few days without rebooting but only hibernating the system.