VSCodeVim / VSCodeVim/Vim

`workbench.action.openEditorAtIndex1` broken in Vim mode

Open
#1,648 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug status/needs-more-info
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

  • Click thumbs-up 👍 on this issue if you want it!
  • Click confused 😕 on this issue if not having it makes VSCodeVim unusable.

The VSCodeVim team prioritizes issues based on reaction count.


Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Environment:

  • VSCode Version: 1.11.2
  • VsCodeVim Version: 0.6.20
  • OS: Ubuntu Linux

What happened:

I bind key sequence [B (uppercase) to go for first opened tab, then I pressed this combination and the editor (editable area) stuck.

I went to dev tools and found this:

selection_188

shell.ts:475 Converting circular structure to JSON: TypeError: Converting circular structure to JSON
    at Object.i [as stringify] (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:41110)
    at Function.e.replyOK (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:758999)
    at file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:758514
    at Object.g [as _notify] (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:50313)
    at Object.enter (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:53887)
    at _run (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:55715)
    at _completed (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:55156)
    at then (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:57148)
    at Object.enter (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:52966)
    at _run (file:////usr/share/code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:55715)e.onUnexpectedError @ shell.ts:475(anonymous function) @ shell.ts:435e.onUnexpectedError @ errors.ts:68o @ errors.ts:88(anonymous function) @ winjs.base.js:41(anonymous function) @ winjs.base.js:38
winjs.base.js:45 WARNING: Promise with no error callback:107
winjs.base.js:46 Object {exception: TypeError: Converting circular structure to JSON
    at Object.i [as stringify] (file:////usr/share/…, error: null, promise: n.C…s.d…e._creator, handler: undefined, id: 107…}
winjs.base.js:48 TypeError: Converting circular structure to JSON
    at Object.i [as stringify] (marshalling.ts:10)
    at Function.e.replyOK (ipcRemoteCom.ts:32)
    at ipcRemoteCom.ts:235
    at Object.g [as _notify] (winjs.base.raw.js:1170)
    at Object.enter (winjs.base.raw.js:852)
    at _run (winjs.base.raw.js:1068)
    at _completed (winjs.base.raw.js:1036)
    at then (winjs.base.raw.js:1566)
    at Object.enter (winjs.base.raw.js:747)
    at _run (winjs.base.raw.js:1068)

What did you expect to happen:
Go to first opened tab.

How to reproduce it:

  1. define those keys in settings.json:
{
        "vim.otherModesKeyBindingsNonRecursive": [
        {
            "before": ["[", "b"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.previousEditor"
                }
            ]
        },
        {
            "before": ["]", "b"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.nextEditor"
                }
            ]
        },
        {
            "before": ["[", "B"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.openEditorAtIndex1"
                }
            ]
        },
        {
            "before": ["]", "B"],
            "after": [],
            "commands": [
                {
                    "command": "workbench.action.openLastEditorInGroup"
                }
            ]
        }]
}
  1. Navigate to first tab using [B (uppercase)
  2. see the error in dev-tools.

If you bind another command on this shortcut it works fine.
If you do navigate using default shortcut alt+1 then it works okay.
So I blame Vim plugin on this.

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 settings.json keybindings and the [B] sequence, then compare it with the default alt+1 shortcut and inspect the VS Code developer-tools error. Trace how the Vim binding invokes workbench.action.openEditorAtIndex1; done means the first opened tab is selected without the circular-structure error or a stuck editor.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.