ZIm/crates/vim/src
Benjamin Westphal 1fae99a7c4
vim: Add motion support for toggle comments (#14919)
### Summary

This PR adds support for count and object motions to the toggle comments
action in Vim mode. The relevant issue is
[#14337](https://github.com/zed-industries/zed/issues/14337).

For example, `2 g c j` will toggle comments three lines downward. `g c g
g` will toggle comments from the current cursor position up to the start
of the file.

Notably missing from this PR are `g c b` (toggle comments for the
current block) as well as `g c p` (toggle comments for the current
paragraph). These seem to be non-standard.

The new module `normal/toggle_comments.rs` has been copied almost
verbatim from `normal/indent.rs`. Maybe that ought to be abstracted over
but I feel I lack the overview.

Release Notes:

- vim: Added support for count and object motion to the toggle comments
action ([#14337](https://github.com/zed-industries/zed/issues/14337)).
2024-07-22 21:22:10 -06:00
..
normal vim: Add motion support for toggle comments (#14919) 2024-07-22 21:22:10 -06:00
test Multicursor vim registers (#13025) 2024-06-13 20:32:58 -06:00
change_list.rs vim test redux (#11709) 2024-05-11 14:04:05 -04:00
command.rs vim: Add :bd/:bp/:bn (#14623) 2024-07-16 23:06:08 -06:00
editor_events.rs Use UpdateGlobal accessors in more places (#11925) 2024-05-16 13:30:04 -04:00
insert.rs vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
mode_indicator.rs vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
motion.rs vim: Add support for vim::PreviousLineStart motion (#14193) 2024-07-11 16:36:07 -06:00
normal.rs vim: Add motion support for toggle comments (#14919) 2024-07-22 21:22:10 -06:00
object.rs vim: Adjust surrounding_markers method (#14752) 2024-07-18 11:53:51 -06:00
replace.rs vim: Allow count and repeat for "r" and "shift-r" action (#13287) 2024-06-24 09:41:33 -06:00
state.rs vim: Add motion support for toggle comments (#14919) 2024-07-22 21:22:10 -06:00
surrounds.rs vim: Surround in visual mode (#13347) 2024-06-24 09:29:06 -06:00
test.rs vim: Add motion support for toggle comments (#14919) 2024-07-22 21:22:10 -06:00
vim.rs vim: Add motion support for toggle comments (#14919) 2024-07-22 21:22:10 -06:00
visual.rs vim: Fix gv after actions (#14829) 2024-07-19 13:26:55 -06:00