vim: implement <space> in normal mode (#7011)

This fixes #6815 by implementing `<space>` in normal mode in Vim. Turns
out that `<space>` behaves like a reverse `<backspace>` (which we
already had): it goes to the right and, if at end of line, to the next
line.

That means I had to touch `movement::right`, which is used in a few
places, but it's documentation said that it would go to the next line,
which it did *not*. So I changed the behaviour.

But I would love another pair of eyes on this, because I don't want to
break non-Vim behaviour.

Release Notes:

- Added support for `<space>` in Vim normal mode: `<space>` goes to the
right and to next line if at end of line.
([#6815](https://github.com/zed-industries/zed/issues/6815)).
This commit is contained in:
Thorsten Ball 2024-01-30 10:47:39 +01:00 committed by GitHub
parent 4af542567c
commit 7b8bd97652
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 29 additions and 4 deletions

View file

@ -31,6 +31,7 @@
"up": "vim::Up",
"l": "vim::Right",
"right": "vim::Right",
"space": "vim::Space",
"$": "vim::EndOfLine",
"^": "vim::FirstNonWhitespace",
"_": "vim::StartOfLineDownward",