VSCodeVim / VSCodeVim/Vim

Failed to handle key `j`: Failed to handle key `<Esc>`: e.toLocaleUpperCase is not a function

Open
#7,726 0 comments 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

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

VSCodeVim version: 1.22.2

Stack trace
TypeError: Failed to handle key `j`: Failed to handle key `<Esc>`: e.toLocaleUpperCase is not a function
    at Function.IsControlKey (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/configuration/notation.ts:31:15)
    at Function.CompareKeypressSequence (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/actions/base.ts:138:54)
    at _.doesActionApply (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/actions/base.ts:76:18)
    at getRelevantAction (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/actions/base.ts:277:16)
    at j.handleKeyAsAnAction (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/mode/modeHandler.ts:578:20)
    at j.handleKeyEvent (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/mode/modeHandler.ts:478:40)
    at runMicrotasks (<anonymous>)
    at process.keys (internal/process/task_queues.js:93:5)
    at j.handleMultipleKeyEvents (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/mode/modeHandler.ts:371:23)
    at f.handleRemapping (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/configuration/remapper.ts:483:73)
    at f.sendKey (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/configuration/remapper.ts:367:42)
    at t.Remappers.handledAsRemap [as sendKey] (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/configuration/remapper.ts:39:7)
    at j.text [as handleKeyEvent] (/home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/src/mode/modeHandler.ts:459:9)
    at /home/minghui/.vscode/extensions/vscodevim.vim-1.22.2/extensionBase.ts:359:73

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

Start in src/configuration/notation.ts at IsControlKey, then follow the call from src/actions/base.ts:138 through key handling for j and . Reproduce the reported sequence and confirm that it no longer raises the e.toLocaleUpperCase TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.