-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
delete_word_backward
and delete_word_forward
behave unexpectedly in some cases
#2729
Comments
This bug also affect seems to be a problem with "what counts as word" |
Hey! I'm the one who wrote the unit tests and word navigation stuff :) after having a chat about it with @s0LA1337 , we concluded a couple things:
|
My expectations regarding If the one-line-at-a-time approach is not a good fit, I would still expect these bindings to delete everything between the cursor and the next word. In the first example in the OP, this would be |
I think the movements are correct. This is a different style of movement, as seen in Kakoune. I would expect similar movements to select/delete the newlines as well, but I'm still getting used to this new way of thinking compared to similar editors like Vim. |
@AceofSpades5757 yea, just "different style of movement"(tm) which nobody understands. |
I personally don't get Ctrl+left/right navigation in insert mode, it looks wrong to everything I've seen during years of experience. |
@adsick I try notepad, this text area I'm typing in now, and Helix. They all have almost identical ctrl+left/right navigation I'm still a fan of this new style of movement. I'm excited to see what comes from it. |
Fixed by #4392 |
Summary
The
delete_word_backward
anddelete_word_forward
behave unexpectedly in some cases.My impression is that there are two things going on here: my expectation that
\n
counts as a word (which might not be a bug), and unexpected behavior when there's nothing under the cursor (which probably is).Reproduction Steps
delete_word_backward
anddelete_word_forward
to a key in insert mode.delete_word_forward
With the cursor
|
on line 1:Pressing the keybind will remove
type_
,some_
, and thenwords
, leaving the cursor on line 1 and all the newlines intact. I'd expect line 1 (the\n
) to be deleted, then line 2 (another\n
), thentype
(and maybe the following space?), etc.delete_word_backward
With the cursor on line 3:
Pressing the keybind will delete
words
,some_
, and thentype_
. As in the forward case, this will leave the newlines untouched. I'd expect the newlines between the cursor and the words to be deleted one at a time first...
With the cursor at the end of line 1 and no trailing newline:
Nothing happens.
..
With the cursor on line 1 and no trailing newline:
Pressing the keybind will give:
And then the keybind no longer does anything until I reposition the cursor.
..
There's another weird case where, upon using the keybinding, I end up with two spaces between the cursor and whatever words are left, but I can't seem to reproduce it.
Helix log
No response
Platform
Linux (5.18.2-arch1-1)
Terminal Emulator
foot 1.12.1
Helix Version
helix 22.05
The text was updated successfully, but these errors were encountered: