Commit Graph
5 Commits
Author SHA1 Message Date
davidhi7anddino 42df2ba903 vim: Fix cw with count greater than 1 not preserving whitespace correctly (#56585)
In vim, `c {count} w` diverges from the default `w` motion behavior: For
change operations, the `w` motion will be treated like the `e` motion if
the cursor is on a word, preserving whitespace after the N-th word. In
zed, this special case was only implemented for a count of 1, falling
back to incorrectly using the `w` motion if the count is greater than 1.

This PR generalizes this implementation to handle this special case for
any count.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #56563.

Release Notes:

- Fixed: vim `cw` with count greater than 1 not preserving whitespace
correctly

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-06-18 14:50:31 +00:00
Julia Ryan 2445012293 Fix vim cw at end of words (#35300)
Fixes #35269

Release Notes:

- N/A
2025-07-31 03:48:36 -07:00
Hans c57ca1ac00 Fix VIM cw on last character of a word doesn't work as expected: (#10963)
At the moment, using the default expand_selection seems to do the job
well, without the need for some additional logic, which may also make
the code a little clearer, Fix #10945



Release Notes:


- N/A
2024-04-25 21:09:06 -06:00
Max Brunsfeld 82724cac3f Use a more stable, readable serialization format for neovim-backed vim tests 2023-03-22 14:31:11 -07:00
K Simmons b488a375c6 Fix panic in vim motion when not listed as exclusive and add features enum to capture why tests are ignored 2022-10-24 18:27:56 -07:00