VSCodeVim / VSCodeVim/Vim

Exiting Insert mode loses multiple cursors when Insert mode was entered from Visual mode via `I` or `A`

Open
#7,008 1 comment 3 reactions 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
When selecting multiple occurrences of a word or selection via Ctrl + D, then entering Insert mode with c, then entering Normal mode via Escape, the multiple cursors are preserved (great!). However if Insert mode was entered via Shift +i or Shift + a, then the additional cursors are lost. In both cases Insert mode was entered directly from Visual mode but afterwards they behave differently. I believe this is a discrepancy that shouldn't exist and makes me sad :(

The best workaround I can see is to enter Normal mode (from Visual mode) via Ctrl + [ before entering Insert mode. That way the cursors are preserved upon exiting Insert mode.

To Reproduce
Steps to reproduce the behavior:

  1. Select multiple occurrences of a word or selection via Ctrl + D
  2. Enter Insert mode via Shift + i or Shift + a
  3. Type some text (optional)
  4. Exit Insert mode via Escape
  5. Only the first cursor remains

Expected behavior
Exiting Insert mode into Normal mode should retain all cursors. Then pressing Escape once more in Normal mode should clear the additional cursors.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.21.6
  • VSCode version: 1.59.0
  • OS: Windows 11 Pro

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 behavior in VSCodeVim with Ctrl+D, Shift+I or Shift+A, and Escape, then compare that transition with entering Insert mode via c. Done means exiting Insert mode retains all cursors, while a second Escape in Normal mode clears the additional cursors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.