ZIm/crates/vim/src/normal
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
..
case.rs vim: Fix gv after actions (#14829) 2024-07-19 13:26:55 -06:00
change.rs Multicursor vim registers (#13025) 2024-06-13 20:32:58 -06:00
delete.rs Multicursor vim registers (#13025) 2024-06-13 20:32:58 -06:00
increment.rs vim: Fix gv after actions (#14829) 2024-07-19 13:26:55 -06:00
indent.rs Implement Indent & Outdent as operators (#12430) 2024-06-04 15:17:01 -06:00
mark.rs vim gigv (#13028) 2024-06-14 10:16:59 -06:00
paste.rs vim: Fix gv after actions (#14829) 2024-07-19 13:26:55 -06:00
repeat.rs vim: Support for q and @ (#13761) 2024-07-03 09:03:39 -06:00
scroll.rs vim: Fix ctrl-d/u going to top bottom (#14620) 2024-07-16 22:56:44 -06:00
search.rs vim: Fix gv after actions (#14829) 2024-07-19 13:26:55 -06:00
substitute.rs vim: Fix gv after actions (#14829) 2024-07-19 13:26:55 -06:00
toggle_comments.rs vim: Add motion support for toggle comments (#14919) 2024-07-22 21:22:10 -06:00
yank.rs Multicursor vim registers (#13025) 2024-06-13 20:32:58 -06:00