VSCodeVim / VSCodeVim/Vim

increment (<C-a>) and decrement (<C-x>) don't work for large numbers

Open
#9,526 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

Describe the bug
<C-a> and <C-x> do not properly increment/decrement numbers whose magnitude is larger than Number.MAX_SAFE_INTEGER. They will either jump to the nearest representable binary64 float or remain unchanged.

To Reproduce
Steps to reproduce the behavior:

Press <C-a> on any number larger than 9007199254740991.

  newTest({
    title: 'can ctrl-a a large number',
    start: ['|18446744073709551615'],
    keysPressed: '<C-a>',
    end: ['1844674407370955161|6'],
  });

Expected behavior
The number should be changed by 1.

Screenshots

Not applicable.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.29.0
  • VSCode version: 1.97.1
  • OS: Darwin arm64 24.3.0

Additional context

Not applicable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the existing newTest case for Ctrl-A and the related Ctrl-X tests, then run them to reproduce behavior beyond Number.MAX_SAFE_INTEGER. Done means the large-number cases increment or decrement by exactly 1, including the provided 18446744073709551615 example.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.