Visual line mode doesn't handle Up/Down arrow keys
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
In visual line mode, Up and Down arrow keys are not handled and cause the cursor to move, but the Vim selection is not updated. This feels buggy and prevents me from using visual line mode. I use a keymap where j and k are not on the home row, but Up and Down are on the home row behind a modifier key.
To Reproduce
Steps to reproduce the behavior:
- Enter visual line mode (
V) - Press down arrow
Expected behavior
Down arrow should behave like j in Visual line mode, same for up arrow and k.
Screenshots
Sorry I don't have screenshots
Log output:
024-06-02 18:46:44.528 [debug] Handling key: V
2024-06-02 18:46:44.529 [debug] Status bar: -- VISUAL LINE --
2024-06-02 18:46:45.014 [debug] Selection change: [101, 32], [101, 32], SelectionsLength: 1
2024-06-02 18:46:45.725 [debug] Selection change: [102, 32], [102, 32], SelectionsLength: 1
2024-06-02 18:46:48.695 [debug] Handling key: <left>
2024-06-02 18:46:49.162 [debug] Handling key: <right>
Here pressing the down key twice causes these "selection change" events, but no "Handling key" event. In the editor the selection moves down one line, but visual line is not exited. As you can see the right or left keys are handled by Vim. I would expect to see Handling key: <down> here.
Maybe this is related to these conditions in the package.json:
Nothing I have tried in terms of remapping worked. I tried remapping down to j, and then directly within keybindings.json to extension.vim_down, but that didn't help.
Environment (please complete the following information):
- Extension (VsCodeVim) version: v1.27.2
- VSCode version: VSCodium 1.89.1
- OS: Manjaro
Additional context
Add any other context about the problem here.
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
Start by inspecting the conditions in package.json around lines 114-122, then reproduce the issue by entering visual line mode with V and pressing Up or Down. Compare arrow-key handling with the logged Left and Right events. Done means Up and Down are handled by Vim and update the visual-line selection like k and j.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100