Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 0.16.6 cause <tab> key insert string for unknown reason #3096

Closed
michael-land opened this issue Oct 5, 2018 · 5 comments · Fixed by #3108
Closed

version 0.16.6 cause <tab> key insert string for unknown reason #3096

michael-land opened this issue Oct 5, 2018 · 5 comments · Fixed by #3108

Comments

@michael-land
Copy link

michael-land commented Oct 5, 2018

To Reproduce
Steps to reproduce the behavior:

I don't know how to reproduce it. It insert <tab> string when press tab key. BTW, Anyone knows how to install an older version?

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.

@vityas-off
Copy link

Same here
microsoft/vscode#59925

@ruffin--
Copy link

ruffin-- commented Oct 5, 2018

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

@shawnaxsom
Copy link
Contributor

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.

@shawnaxsom
Copy link
Contributor

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.

@shawnaxsom
Copy link
Contributor

^^ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants