VSCodeVim / VSCodeVim/Vim

[cursor movement] press `escape` will jump to previous position

Open
#8,624 4 comments 19 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

Describe the bug

When triggering the code snippet in insert mode, undo this, then esc to exit insert mode, and the cursor will jump back to the previous position.

Afterwards, you enter insert mode again and use meta/alt + arrow keys to move left or right. As long as you exit insert mode, the cursor will return to its position before entering insert mode.

Unless you reload window, otherwise, any cross-region movement done in insert mode (including alt + arrow keys or cursor movement caused by code completion) will not be preserved in normal mode.

To Reproduce
Steps to reproduce the behavior:

https://github.com/VSCodeVim/Vim/assets/41265413/ad6083eb-f39f-4e9a-9f9f-abaa74ea6126

  1. Enter insert mode, expand a snippets, then press esc to exit insert mode. The cursor will jump back
  2. Enter insert mode again, and alt + left or + right to move the cursor
  3. Exit insert mode.
  4. Cursor will Jump back

Expected behavior

The cursor should remain in the position under insert mode.

Screenshots

See the video above.

Environment (please complete the following information):

  • Extension (VsCodeVim) version:v1.26.0
  • VSCode version: 1.82.2
  • OS:macOS

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 issue in VSCodeVim using the listed snippet, Escape, and Meta/Alt+arrow steps, checking whether the cursor returns to its pre-insert position. Trace the insert-mode exit and cursor movement behavior; done means the cursor remains at its final insert-mode position without requiring a window reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools, 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.