Vim: version 0.16.6 cause <tab> key insert string for unknown reason

Created on 5 Oct 2018  路  5Comments  路  Source: VSCodeVim/Vim

To Reproduce
Steps to reproduce the behavior:

I don't know how to reproduce it. It insert

screen shot 2018-10-04 at 6 58 04 pm

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Extension (VsCodeVim) version:
  • VSCode version:
  • OS:

Additional context
Add any other context about the problem here.

Most helpful comment

PR #3108 is up and will fix the issue by updating vim.mode (used by keybindings) whenever changing tabs.

In the meantime, workarounds are:

  • Open new tabs while in normal mode whenever possible (assuming vim.startInInsertMode setting is false)
  • Or press <Esc> if you do get into the bad state. Changing mode with a keypress in this manner will correct the issue.

All 5 comments

When I'm in this "state" in insert mode where <tab> is literally inserted, I also tend to lose the ability to use Home, End, Delete, and other "normal" button functions. Often to usually, escaping into command mode and going back into insert mode fixes this.

This is...

  • Vim version 1.0.39
  • Windows 10 build 15063.1356
  • VS Code 1.27.2

This is related to a recent change related to performance:

    if (this._previousMode !== this.vimState.currentMode) {
      await vscode.commands.executeCommand(
        'setContext',
        'vim.mode',
        ModeName[this.vimState.currentMode]
      );
      this._previousMode = this.vimState.currentMode;
    }

This was the right move for performance reasons, but we need to make sure to send vim.mode when a window on tab change. You won't see issues if you change or open a tab that is in the same mode, but the issue happens if the tabs are in different modes and the vim.mode isn't updated.

Otherwise it won't send vim.mode until changing mode again, such as pressing Escape as @ruffin-- mentioned.

I can reproduce by starting insert mode, then opening a new tab (where the new tab opens in normal mode), return to the previous tab still in insert mode, and press <Tab>.

I'll get to working on a fix this weekend.

PR #3108 is up and will fix the issue by updating vim.mode (used by keybindings) whenever changing tabs.

In the meantime, workarounds are:

  • Open new tabs while in normal mode whenever possible (assuming vim.startInInsertMode setting is false)
  • Or press <Esc> if you do get into the bad state. Changing mode with a keypress in this manner will correct the issue.

^^ PR is merged and should be resolved with the next VSCodeVim release. There was a prior release last night, so it might be a few days I'd imagine for the next release with this fix.

This won't fix replace mode issues with tab (see #2499), but it fixes the insert mode issues discussed here. Let me know if there are any use cases that we might be missing otherwise.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lucastheisen picture lucastheisen  路  3Comments

typeoneerror picture typeoneerror  路  3Comments

cckowin picture cckowin  路  3Comments

ACollectionOfAtoms picture ACollectionOfAtoms  路  3Comments

gerardmrk picture gerardmrk  路  3Comments