Failed to handle key=<Esc>. Cannot read property 'cursorStartPosition' of undefined
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Problem: loses the ability to accept the key.
Environment
- MacOS 10.15.7. Macbook Pro, 15", 2019
- VSCode 1.15.1 with Vim extension.
To Reproduce
- Open VS Code for an existing script.
- Type control-v at the start of a line.
- Hit
ja bunch of times to multi-select the first character of several rows - Hit capital
Ito go to multi-insert mode - Type
#then<space>to enter those characters, then<Esc>to make them appear on each line
- Note: there was a two-space indent for some, but not all of these lines.
- Type
uto undo because that's the wrong comment character for typescript - Notice that the first characters of those rows are now selected again.
- Type
/
Expected result: I input a / character
Actual result:
VSCode complains when I enter any character at this point.
VSCodeVim version: 1.17.1
Stack trace
TypeError: Failed to handle key=<Esc>. Cannot read property 'cursorStartPosition' of undefined
at A.exec (/Users/will/.vscode/extensions/vscodevim.vim-1.17.1/out/extension.js:9:437666)
at A.execCount (/Users/will/.vscode/extensions/vscodevim.vim-1.17.1/out/extension.js:1:37019)
at F.runAction (/Users/will/.vscode/extensions/vscodevim.vim-1.17.1/out/extension.js:9:475409)
at F.handleKeyAsAnAction (/Users/will/.vscode/extensions/vscodevim.vim-1.17.1/out/extension.js:9:474805)
at F.handleKeyEvent (/Users/will/.vscode/extensions/vscodevim.vim-1.17.1/out/extension.js:9:471614)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:94:5)
at async Object.promise (/Users/will/.vscode/extensions/vscodevim.vim-1.17.1/out/extension.js:9:231560)
at async Object.runTasks (/Users/will/.vscode/extensions/vscodevim.vim-1.17.1/out/extension.js:9:621914)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the multi-selection, insert, undo, and slash sequence in VS Code using the stated macOS and extension versions. Start from the key-handling path shown in the extension.js stack trace, then verify that Escape and the following slash are accepted without an exception and that the expected selections remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100