VSCodeVim / VSCodeVim/Vim

The `.` (last inserted text) register gets updated with `<C-a>` instead of the actual inserted text, after using `<C-a>` in Insert mode

Open
#6,221 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

After using the <C-A> key in insert mode and then leaving insert mode, the . register gets updated with <C-A> instead of the actual text that was inserted. If I then enter insert mode again, and use <C-A> again, nothing is inserted, as the <C-A> would use the . register to insert text. Therefore, <C-A> can be used only once, which is unfortunate.

To Reproduce

  1. Enter insert mode, write some text.
  2. Leave insert mode.
  3. Enter insert mode again, press <C-A>, and see that your last written text is inserted.
  4. Leave insert mode.
  5. Enter insert mode again, press <C-A>, and see that nothing is inserted

Expected behavior

The second time I enter insert mode and use <C-A>, I would expect that it again inserts the text that was last inserted. This would be possible, if the . register would be updated with the actual text, and not with <C-A>

Environment:

  • Extension (VsCodeVim) version: 1.18.9
  • VSCode version: 1.53.1
  • OS: macOS Catalina, version: 10.15.7

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 reproducing the Insert mode sequence described in this issue, then trace the handling of and updates to the '.' register in the TypeScript codebase. Done means pressing after leaving and re-entering Insert mode repeatedly inserts the last inserted text rather than updating the register with the key sequence.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.