helix icon indicating copy to clipboard operation
helix copied to clipboard

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

Open xJonathanLEI opened this issue 3 years ago • 1 comments

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 avatar Oct 17 '22 02:10 xJonathanLEI

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

xJonathanLEI avatar Oct 17 '22 03:10 xJonathanLEI