VSCodeVim / Vim

:star: Vim for Visual Studio Code
http://aka.ms/vscodevim
MIT License
13.99k stars 1.32k forks source link

Unnecessary timeout on key press #7268

Open kostaskriaridis opened 3 years ago

kostaskriaridis commented 3 years ago

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

max-sixty commented 2 years ago

Is this caused by Remapper: debug: normalModeKeyBindingsMap. ambiguous match found. before=c. after=i. command=undefined. waiting for other key or timeout to finish.? Are there other mappings that start with c?

kostaskriaridis commented 2 years ago

Hello, @max-sixty, thank you for your reply! = )

Answering to your question: no, there are no other mappings for c. This looks really strange that I have a strange timeout. Currently I use this mappings, and as you see, there is only one binding for c

max-sixty commented 2 years ago

I imagine this is it: https://github.com/VSCodeVim/Vim/issues/6812

kostaskriaridis commented 2 years ago

Yeah, looks like the same issue, thank you 🙏