VSCodeVim / VSCodeVim/Vim

With `normalModeKeyBindings`, typing `< >` in Normal mode breaks keyboard input.

Open
#3,860 0 comments 0 reactions 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

After adding any custom mapping with Ctrl in it (e.g. <C-n>) to normalModeKeyBindings (and/or normalModeKeyBindingsNonRecursive) and typing < > in Normal mode breaks keyboard input.

  1. Add line "vim.normalModeKeyBindingsNonRecursive": [ { "before":["<C-n>"], "commands": [ ":nohl" ] } ] to your settings.json (example remapping from documentation).
  2. Open any file, even empty.
  3. Type < >.
  4. Any further input will be directed into the status bar, to the left of Mode indicator. Even pressing <C-c> and/or <Esc> will only generate more text, but wont exit this... State.

Expected that command < > will be recognized as faulty and wrong, the Vim will leave "operator pending mode" and return to Normal mode. By the way, command > < behaves just like that, simply returning to Normal mode.

Example of a broken status line:
Example of a broken status line

  • Extension (VsCodeVim) version: 1.8.1
  • VSCode version: 1.35.1
  • OS: Windows 10 1903

There are more remapping in my settings, but the bug can be reproduced with only one line in settings.json. It's only caused by Ctrl based mappings, mapping single letters or letter sequences to Vim or VS Code commands does not trigger the bug, at least in my case.

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

Reproduce the issue using the normalModeKeyBindingsNonRecursive entry in settings.json and the documented Ctrl-n mapping, then trace the normal-mode keybinding and operator-pending handling. Done means < followed by a space and > returns to Normal mode without trapping subsequent input in the status bar, while the existing > < behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.