Vim icon indicating copy to clipboard operation
Vim copied to clipboard

Version 0.16.10 stuck in insert mode

Open lengingerlabs opened this issue 8 years ago • 14 comments

Escape or any of the other keys don't work. Downgrading to 0.16.9 fixes the problem.

lengingerlabs avatar Oct 17 '18 01:10 lengingerlabs

I am having the same error and it is fixed with 0.16.9 as well.

Here is error logs shown in the developer tool.

[Extension Host] Here is the error stack:  TypeError: Cannot read property 'document' of undefined
	at Function.getDocumentName (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/src/textEditor.js:62:47)
	at SearchState._recalculateSearchRanges (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/src/state/searchState.js:52:88)
	at SearchState.set searchString [as searchString] (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/src/state/searchState.js:43:18)
	at new SearchState (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/src/state/searchState.js:25:27)
	at GlobalState._searchHistory.get.forEach.val (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/src/state/globalState.js:26:63)
	at Array.forEach (<anonymous>)
	at GlobalState.loadSearchHistory (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/src/state/globalState.js:26:18)
	at /Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/extension.js:248:21
	at Generator.next (<anonymous>)
	at /Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/extension.js:7:71
	at new Promise (<anonymous>)
	at __awaiter (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/extension.js:3:12)
	at activate (/Users/yoshiki.ozaki/.vscode/extensions/vscodevim.vim-0.16.10/out/extension.js:64:12)
	at Function.t._callActivateOptional (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:626:411)
	at Function.t._callActivate (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:626:90)
	at /Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:625:263
	at Object.g [as _notify] (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:78:971)
	at Object.enter (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:82:277)
	at n.Class.derive._oncancel._run (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:84:100)
	at n.Class.derive._oncancel._completed (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:83:559)
	at c (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:86:1011)
	at $.then.o.(anonymous function) (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:87:205)
	at Object.g [as _notify] (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:78:971)
	at Object.enter (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:82:277)
	at n.Class.derive._oncancel._run (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:84:100)
	at n.Class.derive._oncancel._completed (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:83:559)
	at c (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:86:1011)
	at $.then.o.(anonymous function) (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:87:205)
	at Object.g [as _notify] (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:78:971)
	at Object.enter (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:82:277)
	at n.Class.derive._oncancel._run (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:84:100)
	at n.Class.derive._oncancel._completed (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:83:559)
	at e.resolveOk (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:444:313)
	at t._receiveReply (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:640:117)
	at t._receiveOneMessage (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:638:425)
	at /Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:635:926
	at /Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:98:138
	at e.fire (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:99:496)
	at a (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:154:213)
	at Socket._socketDataListener (/Users/yoshiki.ozaki/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:154:432)
	at emitOne (events.js:116:13)
	at Socket.emit (events.js:211:7)
	at addChunk (_stream_readable.js:263:12)
	at readableAddChunk (_stream_readable.js:250:11)
	at Socket.Readable.push (_stream_readable.js:208:10)
	at Pipe.onread (net.js:594:20)

ikazoy avatar Oct 17 '18 06:10 ikazoy

Uninstalling and reinstalling the extension has fixed this for me

MVBond avatar Oct 17 '18 14:10 MVBond

Same issue here. Reinstalling did not help.

gforceg avatar Oct 17 '18 16:10 gforceg

@lengingerlabs how do you downgrade?

gforceg avatar Oct 17 '18 16:10 gforceg

You can follow these instructions to downgrade:

https://tpodolak.com/blog/2017/04/09/downgrading-visual-studio-code-extension/

publisher: vscodevim extension: vim version: 0.16.9

Vscode seems to want a .vsix extension, so you may need to change the extension of the downloaded file.

lengingerlabs avatar Oct 17 '18 16:10 lengingerlabs

thanks. i got it

short version: ctrl + shift + p => install from VSIX enter this URL https://vscodevim.gallery.vsassets.io/_apis/public/gallery/publisher/vscodevim/extension/vim/0.16.9/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage

also, make sure that autoupdate extensions is not enabled in settings.

gforceg avatar Oct 17 '18 16:10 gforceg

Next time this happens can someone try restarting vscode twice? I had to restart vscode twice for some reason after the upgrade before things worked normally...

xconverge avatar Oct 17 '18 20:10 xconverge

@xconverge have restarted to fix numerous times throughout the day. pops up again eventually.

typeoneerror avatar Oct 17 '18 21:10 typeoneerror

I have more or less the same issue, I have to either reinstall vscode or the extension to get it to work. but the issue always reappears.

it gets stuck in search, insert or visual mode.

I'm using version 0.16.10.

a-eid avatar Oct 18 '18 00:10 a-eid

Until this bug is fixed, opening VSCode and running cmd+shift+p selecting "Reinstall Extension" and choosing "VSCode Vim" seems to fix the issue. You have to remember to do this every time you open the editor, though.

rzane avatar Oct 18 '18 02:10 rzane

@xconverge https://github.com/VSCodeVim/Vim/issues/3143#issuecomment-430504105 stack trace points to bug introduced with https://github.com/VSCodeVim/Vim/pull/3116? Is it cause we are now reading from the same file if we have two editors open?

jpoon avatar Oct 18 '18 04:10 jpoon

Same issue here. It's annoying as hell...

jfrancisco-neto avatar Oct 18 '18 12:10 jfrancisco-neto

I might be able to take a look.

I found valid reproduction steps, and I think the stack trace from @ikazoy and #3116 are relevant given the steps to reproduce.

  1. Close all vscode tabs
  2. Restart vscode, opening the same project that has no persistent tabs
  3. Open a file and enter insert mode
  4. Press escape

It must not like the fact that it wasn't able to find a VSCode activeEditor textDocument on loading the file, maybe something to do with the persistence of the search history in #3116.

So a workaround besides downgrading is to:

  1. Open at least one vscode tab
  2. Persist the tab (either by running the "View: Keep Editor" command, or by pressing e.g. Cmd+K, Enter on Mac, or by double clicking the tab)
  3. Restart vscode, and reopen the same project that has a persistent tab.

shawnaxsom avatar Oct 18 '18 14:10 shawnaxsom

Spun up a fix in a quick PR with #3146. It seems to fix the issue without regressing #3116. This should be good as a permanent fix, not a stop-gap.

shawnaxsom avatar Oct 18 '18 15:10 shawnaxsom