VSCodeVim / VSCodeVim/Vim

Unnecessary timeout on key press

Open
#7,268 4 comments 1 reaction 0 assignees View on GitHub

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:

  1. Install VSCode
  2. Install Vim extension
  3. Turn on Dvorak keyboard on your system
  4. Put to settings.json remapper for normalModeKeyBindingsNonRecursive;
  5. Enter NORMAL mode and press i (Dvorak's c).

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.