Bug 487644 - Word deletion and drag and drop behavior in Kate and Kwrite is suboptimal
Summary: Word deletion and drag and drop behavior in Kate and Kwrite is suboptimal
Status: REPORTED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 22.12.3
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
: 497152 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-05-27 20:14 UTC by Paul B.
Modified: 2024-12-17 05:33 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul B. 2024-05-27 20:14:22 UTC
STEPS TO REPRODUCE
1. Attempt to delete word using ctrl-delete
2. Only space is deleted. Press ctrl-delete again
3. now the word and its trailing space are  deleted

OBSERVED RESULT
two words undesirably joined together

EXPECTED RESULT
two words with space between

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,

word^(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 space1 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.

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.

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.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: MX Linux 23 (debian), KDE
(available in About System)
KDE Plasma Version:  KDE Plasma v: 5.27.5 wm: kwin_x11 vt: 7
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Waqar Ahmed 2024-09-18 18:43:46 UTC
I agree on the ctrl-delete issue, but not drag and drop. DND is working as expected => double click should just select the word.
Comment 2 Waqar Ahmed 2024-10-19 18:42:36 UTC
I tried changing this but this really is quite a big change, it affects a lot of things
Comment 3 Christoph Cullmann 2024-10-19 18:46:02 UTC
(In reply to Waqar Ahmed from comment #2)
> I tried changing this but this really is quite a big change, it affects a
> lot of things

If that leads to a big behavior change that might annoy a lot of long time users.
Comment 4 Waqar Ahmed 2024-10-19 18:50:01 UTC
behaviour change might not be that big but a lot of things in ktexteditor rely on this wordNext behaviour e.g,. the vimode IIRC and other things and a lot of tests start failing.
Comment 5 Waqar Ahmed 2024-12-17 05:33:11 UTC
*** Bug 497152 has been marked as a duplicate of this bug. ***