VSCodeVim / VSCodeVim/Vim

Cursor position lost when re-focusing editor and hitting escape

Open
#2,917 2 comments 13 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 the editor window loses focus and is then refocused, upon hitting "escape", the scroll position snaps back to the old position it was at before losing focus. That means when you click back into the editor and hit escape your scroll position snaps back, which is confusing.

To Reproduce
Steps to reproduce the behavior:

  1. Open file
  2. Split file vertically (not necessary but helps test)
  3. Open new file on one side
  4. Focus new file
  5. Focus back to old file using mouse
  6. Hit escape

Notice the cursor goes back to the old position rather than staying at the current position.

Expected behavior
Cursor does not change after hitting escape

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Extension (VsCodeVim) version:
  • VSCode version: 0.15.7
  • OS: Mac OS 10.13.3

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 by reproducing the six-step sequence in VSCodeVim on the reported VS Code and macOS versions, checking the cursor and scroll position before and after refocusing and pressing Escape. Done means the cursor and scroll position remain unchanged after Escape; no source file or test is identified in the issue.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.