VSCodeVim / VSCodeVim/Vim

Dirty flag not removed when undoing changes.

Open
#9,467 3 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

When using VS Code with the Vim extension, I notice that:

In Vim: If you make changes to a file and then undo those changes using the u key, Vim recognizes that the buffer content matches the original file on disk. As a result, it clears the modified flag (+ in the filename) and doesn't prompt you to save upon exit.

In VS Code with Vim Extension: After making changes and undoing them with u, VS Code still marks the file as modified (indicated by a dot ● in the file tab or a dirty indicator), even though the file content matches the saved version. This means VS Code prompts you to save the file upon closing, even when no actual changes exist.

Vim's behaviour is really helpful when having changed a file accidentally, as it shows when being back to the original state by removing the dirty flag.

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

No source file or test is named. First reproduce the issue in VS Code with the Vim extension by editing a file and undoing with the u key, then trace the extension's undo and dirty-state handling. Done means returning to the saved content clears the dirty indicator and avoids an unnecessary save prompt.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.