Sub-optimal behavior of the text cursor in Kate and Kwrite

(Please move if in wrong forum. I also posted this on reddit, but auto-mod there said here is better.)

I find that the text cursor in Kate (22.12.3) and Kwrite is not set to optimal behavior.

In the following string, if the cursor is directly after word1 and before its following space,

word1(space1)word2(space2)word3

and I want to delete word2, I will hit Ctrl-Delete. I expect the word to be taken out, but instead only the next space is removed:

word1|word2(space2)word3

So I hit ctrl-delete once again, and now word2 is taken out as I had wanted. But that action also takes out the space trailing word2, leaving word1 and word3 joined together without a space between them.

word1|word3

So now I have to the desired space. This, done many times, adds up to a rough work flow. Instead of one key combination, I have three inputs to delete a word properly.

I don’t have this problem writing in reddit in the Vivaldi browser. What it does do there, though, is attach a word’s following space to the word, and so deletes it with the word, and sometimes that is not desired.

Libreoffice has the opposite problem from Vivaldi, it attaches the space preceding a word to the word, and deletes it with it, again something not always desired.

What would be good is some kind of intelligent coupling of word and space, so that Ctrl-Delete and Ctrl-Backspace would have smoother results. This is what happens in google docs. It intelligently removes the desired word, always leaving exactly one space between the two newly adjoining words. That’s how I remember Windows working also. If this problem would be remedied, I think text editing would be a lot smoother for kate and kwrite.

Both readline and vscode works like Libreoffice, i.e. first delete all whitespaces to the right, then delete until the first whitespace to the right.

Maybe not very intelligent, but seems this is the most common implementation, and perhaps Kate should use it too.

Thanks. What you describe I think would be the solution for ctrl-delete (with it being reversed for ctrl-backspace), but that is not what Libreoffice does. It deletes the next space, the next word, and its following space all together. If the cursor is before a space, the program should assume that ctrl-delete wants to take out both it and the following word. But it should leave the next space intact. And Kate/Kwrite’s behavior adds an extra step to the process, still leaving the need to reinsert the deleted space.

1 Like

There’s also a corollary to this problem. Double-clicking a word to select it selects only strictly the word, and not either one of its adjoining spaces. This means that dragging and dropping the word elsewhere will require adding the missing space back to it, then going back to the original location and deleting the space that was left there. If one of the adjoining spaces were selected with the word, the two extra steps could be avoided.

I raise these issues because I’m doing a large project and Kate is the editor I work in. All this extra clicking really does add up.

Thanks.

I got here a little late, and would like to point out that not all KDE developers read or participate in the forums. This is a good space to discuss features with a random selection of people who are interested in the topic, which might or might not include KDE contributors. If you want it noticed and hopefully fixed by the Kate devs themselves, the best way to do so is by filing a bug report at bugs.kde.org.

I appreciate your write-up by the way, it makes sense to me subjectively! (But also I’m not a Kate developer, so I don’t have the necessary background to really argue one way or another.)

1 Like

Thanks for that. I had wondered about that, and was considering going the bug route if this thread had produced no fruit. I probably will get to that soon.

1 Like

Here’s the bug in all its glory:

https:// bugs.kde. org/show_bug.cgi?id=487644

1 Like