Skip to content

Arrow key bindings not working with insertModeKeyBindings #2924

@karlhorky

Description

@karlhorky

Describe the bug

The configuration for navigation with arrow keys across word wrapped lines from #2403 (comment) no longer works.

Bonus: The configuration does work with a separate, unrelated configuration.

To Reproduce
Steps to reproduce the behavior:

  1. Install the plugin
  2. Enable word wrapping ("editor.wordWrap": "on")
  3. Configure using the config in broken.json below
  4. Notice that the up and down keys skip text past the wrap on word wrapped lines (notice that both ctrl+o and <C-o> do not work)
  5. Bonus: Configure using the config in working.json below
  6. Bonus: Notice that the up and down keys navigate to every line, even text on word wrapped lines.

broken.json

{
  "vim.insertModeKeyBindings": [
    {
      "before": [
        "down",
      ],
      "after": [
        "<C-o>",
        "g",
        "j"
      ]
    },
    {
      "before": [
        "up"
      ],
      "after": [
        "ctrl+o",
        "g",
        "k"
      ]
    }
  ]
}

working.json

{
  "vim.insertModeKeyBindings": [
    {
      "before": [
        "j"
      ],
      "after": [
        "<Esc>"
      ]
    },
    {
      "before": [
        "down"
      ],
      "after": [
        "<C-o>",
        "g",
        "j"
      ]
    },
    {
      "before": [
        "up"
      ],
      "after": [
        "ctrl+o",
        "g",
        "k"
      ]
    }
  ]
}

Expected behavior

The configuration should work in both cases (not only with the extra j => Esc configuration key).

Logs

Broken:

Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] debug: Extension: activating vscodevim.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] debug: Extension: registering event handlers.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] debug: ModeHandler: handling key=<ExtensionEnable>.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=i.
2console.ts:136 [Extension Host] debug: ModeHandler: handling key=<up>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
2console.ts:136 [Extension Host] debug: ModeHandler: handling key=<up>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<up>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<up>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
2console.ts:136 [Extension Host] debug: ModeHandler: handling key=<up>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<down>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<down>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 

Working:

Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] debug: Extension: activating vscodevim.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] debug: Extension: registering event handlers.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:270 [Extension Host] debug: ModeHandler: handling key=<ExtensionEnable>.
shell.ts:482 [Violation] 'resize' handler took 196ms
[Violation] Forced reflow while executing JavaScript took 37ms
console.ts:136 [Extension Host] debug: ModeHandler: handling key=i.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<down>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=j. after=<Esc>. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. match found. before=<down>. after=<C-o>,g,j. command=undefined.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<C-o>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=j. after=<Esc>. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: ModeHandler: handling key=g.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=j.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<down>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=j. after=<Esc>. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. match found. before=<down>. after=<C-o>,g,j. command=undefined.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<C-o>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=j. after=<Esc>. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: ModeHandler: handling key=g.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=j.
wordHighlighter.ts:300 [Violation] 'setTimeout' handler took 82ms
mouseHandler.ts:94 [Violation] Handling of 'mousewheel' input event was delayed for 122 ms due to main thread being busy. Consider marking event handler as 'passive' to make the page more responsive.
[Violation] 'setTimeout' handler took 62ms
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<up>.
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=j. after=<Esc>. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<down>. after=<C-o>,g,j. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. before=<up>. after=<C-o>,g,k. 
console.ts:136 [Extension Host] debug: Remapper: insertModeKeyBindings. match found. before=<up>. after=<C-o>,g,k. command=undefined.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=<C-o>.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=g.
console.ts:136 [Extension Host] debug: ModeHandler: handling key=k.

Environment (please complete the following information):

  • Extension Name: vim
  • Extension Version: 0.15.7
  • OS Version: Darwin x64 17.7.0
  • VSCode version: 1.25.1

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