To Reproduce
Steps to reproduce the behavior:
I don't know how to reproduce it. It insert Expected behavior Screenshots Environment (please complete the following information): Additional context
A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
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...
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:
vim.startInInsertMode setting is false)<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.
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:
vim.startInInsertModesetting isfalse)<Esc>if you do get into the bad state. Changing mode with a keypress in this manner will correct the issue.