Skip to content

“c” behaves strangely when swapped with “h” #6812

@ejpcmac

Description

@ejpcmac

Describe the bug

In order to be comfortable with the BÉPO keyboard layout, I have swapped hjkl and ctsr. Since VSCodeVim 1.21.0, there is some delay between the moment c is pressed and the cursor effectively moving to the left. If I press it multiple times in a row, it seems to move, but there is still a one-second delay before it is at its “real” position.

To Reproduce
Steps to reproduce the behavior:

  1. Add this configuration:

    "vim.normalModeKeyBindingsNonRecursive": [
        { "before": ["c"], "after": ["h"] },
        { "before": ["t"], "after": ["j"] },
        { "before": ["s"], "after": ["k"] },
        { "before": ["r"], "after": ["l"] },
    ],
  2. Position the cursor so it has some space on its left.

  3. Type c and see the cursor having a one-second delay.

Expected behavior

Like for t, s and r, and even c in previous versions, there should be no delay.

Screenshots

[Extension Host] ModeHandler: debug: handling key=c.
[Extension Host] Remapper: debug: trying to find matching remap. keys=c. mode=Normal. keybindings=normalModeKeyBindingsMap.
[Extension Host] Remapper: verbose: key=c. keySlice=c.
[Extension Host] Remapper: debug: normalModeKeyBindingsMap. ambiguous match found. before=c. after=h. command=undefined. waiting for other key or timeout to finish.
[Extension Host] ModeHandler: debug: handleKeyEvent('c') took 2ms
[Extension Host] ModeHandler: debug: handling key=<timeoutfinished>.
[Extension Host] Remapper: debug: trying to find matching remap. keys=c. mode=Normal. keybindings=normalModeKeyBindingsMap.
[Extension Host] Remapper: verbose: key=c. keySlice=c.
[Extension Host] Remapper: debug: normalModeKeyBindingsMap. match found. before=c. after=h,<TimeoutFinished>. command=undefined. remainingKeys=. mapDepth=1.
[Extension Host] ModeHandler: debug: handling key=h.
[Extension Host] ModeHandler: debug: Selections: Adding Selection Change to be Ignored! Hash: [25, 23; 25, 23], Selections: [25, 23], [25, 23]
[Extension Host] ModeHandler: debug: handleKeyEvent('h') took 6ms
[Extension Host] ModeHandler: debug: handling key=<timeoutfinished>.
[Extension Host] ModeHandler: debug: handleKeyEvent('<timeoutfinished>') took 0ms
[Extension Host] ModeHandler: debug: handleKeyEvent('<timeoutfinished>') took 8ms
[Extension Host] Extension Startup: debug: Selections: Ignoring selection: [25, 23; 25, 23], Count left: 0

=> It seems there is some ambiguity, but I’ve defined the remap only once, so this is very strange.

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.21.3, 1.21.2, 1.21.1, 1.21.0
  • VSCode version: 1.56.2 (but also on latest on my work PC)
  • OS: NixOS 21.05, Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions