Vim handles keystrokes in wrong sequence if Code is not responding immediately
Open
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

- Try to update Line 4466 of the
action.tsof this project and you are adding a)after} - Press
Escand 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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