VSCodeVim / VSCodeVim/Vim

Vim handles keystrokes in wrong sequence if Code is not responding immediately

Open
#1,340 5 comments 5 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

vim-lag

  • Try to update Line 4466 of the action.ts of this project and you are adding a ) after }
  • Press Esc and then . quickly.
  • The content ends up with }). and the state is normal mode.

Code takes a few seconds to handle match bracket logic after you press ) so that's why the Esc doesn't immediately change the cursor style to Block real quick. However Code is sending the events with correct sequence but we didn't handle them in a good order

Code type: a
Vim Handler: a
Code type: )
Vim Handler: )
Code key: <Esc>
Code type: .
Vim handler: .
Vim handler: <Esc>

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 sequence at line 4466 of action.ts: type a closing parenthesis, press Esc, then press . quickly while Code is delayed. Trace the logged Code and Vim event order in the Vim handler, and consider the issue done when the keystrokes produce the expected content and mode despite the delayed bracket handling.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.