VSCodeVim / VSCodeVim/Vim

Failed to handle key=5. Cannot read property 'length' of undefined

Open
#6,466 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
TypeScript
Stars
15.2k
Forks
1.5k
Avg merge
3d 18h
Merged PRs (30d)
6

Description

To Reproduce
Steps to reproduce the behavior:

use vim normal mode to search for

/3.5.2/3.

and I can't press 5

VSCodeVim version: 1.19.3

Stack trace
TypeError: Failed to handle key=5. Cannot read property 'length' of undefined
    at _validatePosition (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:76:2125)
    at Object.validatePosition (/usr/share/code/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:76:255)
    at $.add (/home/ahmad/.vscode/extensions/vscodevim.vim-1.19.3/src/common/motion/position.ts:234:33)
    at c.getNextSearchMatchPosition (/home/ahmad/.vscode/extensions/vscodevim.vim-1.19.3/src/state/searchState.ts:262:21)
    at I.updateView (/home/ahmad/.vscode/extensions/vscodevim.vim-1.19.3/src/mode/modeHandler.ts:1368:51)
    at I.handleKeyAsAnAction (/home/ahmad/.vscode/extensions/vscodevim.vim-1.19.3/src/mode/modeHandler.ts:657:16)
    at runMicrotasks (<anonymous>)
    at process.handledAsAction (internal/process/task_queues.js:97:5)
    at I.text [as handleKeyEvent] (/home/ahmad/.vscode/extensions/vscodevim.vim-1.19.3/src/mode/modeHandler.ts:469:11)
    at Object.promise (/home/ahmad/.vscode/extensions/vscodevim.vim-1.19.3/extensionBase.ts:377:73)
    at Object.runTasks (/home/ahmad/.vscode/extensions/vscodevim.vim-1.19.3/src/taskQueue.ts:36:26)

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 failure in VS Code Vim 1.19.3 by searching in normal mode for /3.5.2/3. and pressing 5. Start with src/common/motion/position.ts at add and src/state/searchState.ts at getNextSearchMatchPosition, using the stack trace as the path. Done means the same search no longer throws when pressing 5.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
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.