VSCodeVim / VSCodeVim/Vim

Failed to handle key=<Esc>. Cannot read property 'cursorStartPosition' of undefined

Open
#5,745 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Open VS Code for an existing script.
  2. Type control-v at the start of a line.
  3. Hit j a bunch of times to multi-select the first character of several rows
  4. Hit capital I to go to multi-insert mode
  5. 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.
  1. Type u to undo because that's the wrong comment character for typescript
  2. Notice that the first characters of those rows are now selected again.
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.