Unnecessary timeout on key press
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
Problem: When editor is in NORMAL mode and press i (Dvorak's c), editor does not enter to INSERT mode immediately, I have to wait for about a second (seems like there is a timeout, see Remapping output section);
Context: I use Dvorak keyboard layout, and I made keys remapping
To Reproduce
Steps to reproduce the behavior:
- Install VSCode
- Install Vim extension
- Turn on Dvorak keyboard on your system
- Put to
settings.jsonremapper fornormalModeKeyBindingsNonRecursive; - Enter
NORMALmode and pressi(Dvorak'sc).
Expected behavior
I want to enter INSERT mode immediately after pressing i (Dvorak's c)
Remapping output
ModeHandler: debug: handling key=c.
Remapper: debug: trying to find matching remap. keys=c. mode=Normal. keybindings=normalModeKeyBindingsMap.
Remapper: verbose: key=c. keySlice=c.
Remapper: debug: normalModeKeyBindingsMap. ambiguous match found. before=c. after=i. command=undefined. waiting for other key or timeout to finish.
ModeHandler: debug: handleKeyEvent('c') took 0ms
ModeHandler: debug: handling key=<timeoutfinished>.
Remapper: debug: trying to find matching remap. keys=c. mode=Normal. keybindings=normalModeKeyBindingsMap.
Remapper: verbose: key=c. keySlice=c.
Remapper: debug: normalModeKeyBindingsMap. match found. before=c. after=i,<TimeoutFinished>. command=undefined. remainingKeys=. mapDepth=1.
ModeHandler: debug: handling key=i.
vscode-context: debug: Setting key='vim.mode' to value='Insert'
ModeHandler: debug: handleKeyEvent('i') took 0ms
ModeHandler: debug: handling key=<timeoutfinished>.
ModeHandler: debug: handleKeyEvent('<timeoutfinished>') took 0ms
ModeHandler: debug: handleKeyEvent('<timeoutfinished>') took 2ms
Environment (please complete the following information):
- Extension (VsCodeVim) version:
1.21.10 - VSCode version:
1.62.3 - OS: Mac OS Big Sur 11.6
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 delay with the settings.json remapper and the NORMAL-mode key sequence described in the issue. Use the Remapper and ModeHandler debug output to follow the ambiguous match and timeout; done means the remapped key enters INSERT mode immediately without waiting for the timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100