Skip to content

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

@xJonathanLEI

Description

@xJonathanLEI

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions