vim: Fix word object count multiplier (2aw, 2iw)#45686
vim: Fix word object count multiplier (2aw, 2iw)#45686ConradIrwin merged 4 commits intozed-industries:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
51fba6b to
e021c61
Compare
Previously, commands like `d2aw` or `2daw` would only delete a single word, ignoring the numeric multiplier. This was because the `times` parameter was passed through the system but the word text object functions (`in_word`, `around_word`) ignored it. This change adds `times` parameter support to: - `in_word()`: Extends selection to include N words - `around_word()`: Propagates times to helper functions - `around_containing_word()`: Passes times to in_word() - `around_next_word()`: Counts words and stops at Nth word - `Object::range()`: Passes times.unwrap_or(1) to word functions
e021c61 to
6452283
Compare
fcc18f6 to
554d76e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
We might need to handle cases where multiple operations include line breaks. |
|
@Kalmaegi good catch |
|
Thank you, and thanks for the tests! |
|
thanks @ConradIrwin! |
Closes zed-industries#44251 ## Context Commands like `2daw` or `c2iw` were ignoring the count multiplier because the word text object functions (`in_word`, `around_word`) weren't using the `times` parameter. This fix propagates the count through these functions so all operators correctly handle multiple words. ## Before https://github.com/user-attachments/assets/d5effa8a-4c04-4d70-a6b5-389cba730ca9 ## After https://github.com/user-attachments/assets/c50e4c0c-ea5c-4673-9c98-3d924b448025 Release Notes: - Fixed vim mode count multiplier for word text objects (`2aw`, `2iw`, `2aW`, `2iW`)
Closes zed-industries#44251 ## Context Commands like `2daw` or `c2iw` were ignoring the count multiplier because the word text object functions (`in_word`, `around_word`) weren't using the `times` parameter. This fix propagates the count through these functions so all operators correctly handle multiple words. ## Before https://github.com/user-attachments/assets/d5effa8a-4c04-4d70-a6b5-389cba730ca9 ## After https://github.com/user-attachments/assets/c50e4c0c-ea5c-4673-9c98-3d924b448025 Release Notes: - Fixed vim mode count multiplier for word text objects (`2aw`, `2iw`, `2aW`, `2iW`)
Closes #44251
Context
Commands like
2daworc2iwwere ignoring the count multiplier because the word text object functions (in_word,around_word) weren't using thetimesparameter. This fix propagates the count through these functions so all operators correctly handle multiple words.Before
Screen.Recording.2025-12-26.at.12.22.44.PM.mov
After
Screen.Recording.2025-12-26.at.12.23.43.PM.mov
Release Notes:
2aw,2iw,2aW,2iW)