helix icon indicating copy to clipboard operation
helix copied to clipboard

Helix cannot delete the last blank line(s) of the buffer when the cursor is at the very last line

Open OpenFoam-User opened this issue 3 years ago • 1 comments

Steps to reproduce:

  • open helix.
  • press i.
  • Press Enter 5 times.
  • press Esc
  • press ge

Now if you keep pressing d key it won't remove all the empty lines. (as it is expected in neovim).

What is the expected behavior:

I expect the cursor to move up to the previous empty line so when you keep pressing d it will delete all the line but it seems that this is not the case for helix.

OpenFoam-User avatar Oct 23 '22 13:10 OpenFoam-User

Helix's d behaves sort-of like Vi's x if Vi's x could act on newlines - it deletes the current selection and the cursor itself is a 1-width selection. In the reproduction steps, the cursor is resting on a newline character and d deletes that character. Then the cursor rests on the EOF character which cannot be deleted. This can be easier to visualize if you enable visible whitespace: https://docs.helix-editor.com/configuration.html#editorwhitespace-section.

This is the intended behavior for d.

the-mikedavis avatar Oct 23 '22 14:10 the-mikedavis

Closing this issue as it's intended behaviour

pascalkuthe avatar Jan 18 '23 11:01 pascalkuthe