Skip to content

Fix vim increment/decrement for negative numbers without gaps - #35200

Closed
kjyv wants to merge 3 commits into
zed-industries:mainfrom
kjyv:vim-increase-no-gaps
Closed

Fix vim increment/decrement for negative numbers without gaps#35200
kjyv wants to merge 3 commits into
zed-industries:mainfrom
kjyv:vim-increase-no-gaps

Conversation

@kjyv

@kjyv kjyv commented Jul 28, 2025

Copy link
Copy Markdown
Contributor

Closes #35193

Release Notes:

  • Fixed behavior for ctrl-a/ctrl-x in vim normal mode for negative numbers without gaps
  • Added a test for that special case

@cla-bot

This comment was marked as outdated.

@kjyv
kjyv force-pushed the vim-increase-no-gaps branch from 0866a53 to 02e2a33 Compare July 28, 2025 13:34
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 28, 2025
@zed-industries-bot

zed-industries-bot commented Jul 28, 2025

Copy link
Copy Markdown
Contributor
Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- Added/Fixed/Improved ...

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 6bb750d

@ConradIrwin

Copy link
Copy Markdown
Member

Thanks!

@ConradIrwin
ConradIrwin enabled auto-merge (squash) August 15, 2025 03:40
@ConradIrwin

Copy link
Copy Markdown
Member

@kjyv Unfortunately it looks like this broke some of the other ctrl-x/ctrl-a tests. Let me know if you need help figuring them out,

@ConradIrwin

Copy link
Copy Markdown
Member

Closing for now, but please feel free to re-open if you get time to work on this more.

auto-merge was automatically disabled August 26, 2025 03:34

Pull request was closed

dinodinu pushed a commit to dinodinu/zed that referenced this pull request Jun 3, 2026
…ndustries#58327)

Finally continuing from PR zed-industries#35200:

I adapted the fix to the changed find_target() logic and added more
tests for version strings like `0.82.46`.
This is a different but similar fix compared to zed-industries#47356 for helix mode -
not sure if this can and should be unified?

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)
(should not affect UI at all)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#35193 

Release Notes:

- Fixed vim's increment (`ctrl-a`) and decrement (`ctrl-x`) commands
skipping the number under the cursor in dotted strings like version
numbers (e.g. `0.81.46`) and hyphened date strings (e.g. `2015-02-01`)

---------

Co-authored-by: Stefan Bethge <kjyv@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
TomPlanche pushed a commit to TomPlanche/zed that referenced this pull request Jun 8, 2026
…ndustries#58327)

Finally continuing from PR zed-industries#35200:

I adapted the fix to the changed find_target() logic and added more
tests for version strings like `0.82.46`.
This is a different but similar fix compared to zed-industries#47356 for helix mode -
not sure if this can and should be unified?

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)
(should not affect UI at all)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#35193 

Release Notes:

- Fixed vim's increment (`ctrl-a`) and decrement (`ctrl-x`) commands
skipping the number under the cursor in dotted strings like version
numbers (e.g. `0.81.46`) and hyphened date strings (e.g. `2015-02-01`)

---------

Co-authored-by: Stefan Bethge <kjyv@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
jonx pushed a commit to jonx/zed-aros that referenced this pull request Jul 17, 2026
…ndustries#58327)

Finally continuing from PR zed-industries#35200:

I adapted the fix to the changed find_target() logic and added more
tests for version strings like `0.82.46`.
This is a different but similar fix compared to zed-industries#47356 for helix mode -
not sure if this can and should be unified?

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)
(should not affect UI at all)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#35193 

Release Notes:

- Fixed vim's increment (`ctrl-a`) and decrement (`ctrl-x`) commands
skipping the number under the cursor in dotted strings like version
numbers (e.g. `0.81.46`) and hyphened date strings (e.g. `2015-02-01`)

---------

Co-authored-by: Stefan Bethge <kjyv@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
jolutz pushed a commit to jolutz/zed that referenced this pull request Aug 8, 2026
…ndustries#58327)

Finally continuing from PR zed-industries#35200:

I adapted the fix to the changed find_target() logic and added more
tests for version strings like `0.82.46`.
This is a different but similar fix compared to zed-industries#47356 for helix mode -
not sure if this can and should be unified?

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)
(should not affect UI at all)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#35193 

Release Notes:

- Fixed vim's increment (`ctrl-a`) and decrement (`ctrl-x`) commands
skipping the number under the cursor in dotted strings like version
numbers (e.g. `0.81.46`) and hyphened date strings (e.g. `2015-02-01`)

---------

Co-authored-by: Stefan Bethge <kjyv@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vim mode: increment/decrement (ctrl-a/x) wrong behavior

3 participants