VSCodeVim / VSCodeVim/Vim

Chorded `insertModeKeyBindings` does not properly update selection location for non-primary selection

Open
#2,742 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

BUG REPORT
VSCodeVim Version: 0.12.0
VSCode Version: 1.24.1
Operating system: all

Let's say I have this config:

"vim.insertModeKeyBindings": [
  {
    "before": ["j","k"],
    "after": [ "<esc>" ]
  },
]

If I have multiple cursors and type jk in insert mode, only the first selection removes the j.

ab|
ab|
ab|

pressing jk leads to

a[]b
ab[]
ab[]

As an aside, is it possible to change the behavior of insertModeKeyBindings so that j is not inserted and then removed in the text document? This seems to mess up vscode dirty-buffer logic, and also causes bad file contents to be sent to language servers.

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 at the insertModeKeyBindings handling for chorded mappings and reproduce the supplied multi-cursor example in VS Code. Trace how the escape action updates each selection, then verify that every non-primary selection removes the temporary input and lands at the expected location; also investigate the reported dirty-buffer and language-server effects.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.