Skip to content
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

Extra character left when deleting words at the end of the buffer #4327

Closed
xJonathanLEI opened this issue Oct 17, 2022 · 1 comment · Fixed by #4328
Closed

Extra character left when deleting words at the end of the buffer #4327

xJonathanLEI opened this issue Oct 17, 2022 · 1 comment · Fixed by #4328
Labels
C-bug Category: This is a bug

Comments

@xJonathanLEI
Copy link
Contributor

xJonathanLEI commented Oct 17, 2022

Summary

An extra character is left untouched when deleting words from the very end of a buffer (with no new line following). Whenever I hit Ctrl-w to delete words, the last character until the cursor position is always left untouched, making it impossible to, say, delete everything before the cursor by repeating Ctrl-w.

Reproduction Steps

I tried this:

  1. Creating an empty file and opening it with no local config:
$ touch test.sh
$ hx -c /dev/null test.sh
  1. Hit the following keys: i a b c. We're now in insert mode with the word abd.

  2. Hit Ctrl-w to delete the word.

I expected this to happen:

We should have an empty buffer now, since the word should be deleted.

Instead, this happened:

The text in the buffer becomes c.

Helix log

~/.cache/helix/helix.log
2022-10-17T10:57:55.139 helix_view::editor [ERROR] Failed to initialize the LSP for `source.bash` { cannot find binary path }

Platform

Linux

Terminal Emulator

tmux 3.3a

Helix Version

22.08.1-229-g09a6df19

@xJonathanLEI xJonathanLEI added the C-bug Category: This is a bug label Oct 17, 2022
@xJonathanLEI xJonathanLEI changed the title Extra character left when deleting words in sh files Extra character left when deleting words Oct 17, 2022
@xJonathanLEI xJonathanLEI changed the title Extra character left when deleting words Extra character left when deleting words at the end of the buffer Oct 17, 2022
@xJonathanLEI
Copy link
Contributor Author

Looks like range calculation is off when the cursor is at the end of the buffer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant