ZIm/crates/vim/src
Vishal Bhavsar 31e9526544
vim: Add support for moving to first, middle and last visible lines (H, L, M) (#6919)
This change implements the vim
[motion](https://github.com/vim/vim/blob/master/runtime/doc/motion.txt)
commands to move the cursor to the top, middle and bottom of the visible
view. This feature is requested in
https://github.com/zed-industries/zed/issues/4941.

This change takes inspiration from
[crates/vim/src/normal/scroll.rs](https://github.com/zed-industries/zed/blob/main/crates/vim/src/normal/scroll.rs).

A note on the behavior of these commands: Because
`NeovimBackedTestContext` requires compatibility with nvim, the current
implementation causes slightly non-standard behavior: it causes the
editor to scroll a few lines. The standard behavior causes no scrolling.
It is easy enough to account for the margin by adding
`VERTICAL_SCROLL_MARGIN`. However, doing so will cause test failures due
to the disparity between nvim and zed states. Perhaps
`NeovimBackedTestContext` should have a switch to be more tolerant for
such cases.

Release Notes:

- Added support for moving to top, middle and bottom of the screen in
vim mode (`H`, `M`, and `L`)
([#4941](https://github.com/zed-industries/zed/issues/4941)).
2024-01-29 20:58:24 -07:00
..
normal Support "dtx" vim key combination when "x" is immediately to the right of the cursor (#6830) 2024-01-28 19:46:14 -07:00
test Work on tests 2024-01-21 22:00:35 -07:00
command.rs Fix panic when typing umlauts in command palette using Vim mode 2024-01-26 10:57:14 +01:00
editor_events.rs text: Wrap BufferId into a newtype 2024-01-29 20:00:47 +01:00
insert.rs Editor docs (#4097) 2024-01-18 00:48:37 +01:00
mode_indicator.rs Use try_global() 2024-01-18 01:33:30 -05:00
motion.rs vim: Add support for moving to first, middle and last visible lines (H, L, M) (#6919) 2024-01-29 20:58:24 -07:00
normal.rs Add support for u and U in vim visual mode 2024-01-28 15:13:09 -05:00
object.rs Start work on API docs for the language crate (#3981) 2024-01-19 10:04:45 -08:00
state.rs Remove 2 suffix for vim, diagnostics, go_to_line, theme_selector, command_palette, file_finder 2024-01-03 10:42:49 -08:00
test.rs Update all links point to community 2024-01-24 15:11:17 -05:00
utils.rs Merge branch 'main' into language-api-docs 2024-01-18 15:06:45 -08:00
vim.rs Fix a few more typos 2024-01-17 14:58:58 -08:00
visual.rs Update all links point to community 2024-01-24 15:11:17 -05:00