microsoft / microsoft/vscode

Markdown editor lets you edit a staged file, and then shows text that is not actually staged

Open
#332,117 0 comments 0 reactions 1 assignee Claimed by @lszomoru View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Does this issue occur when all extensions are disabled?: Yes

- VS Code Version: 1.134.0 (110a328ea54b42367b803ec53ee0bf52ef26b419, arm64)
- OS Version: macOS 26.5 (Darwin 25.5.0), arm64

Steps to Reproduce:

1. In a Git repository, stage a change to a Markdown file.
2. In the Source Control view, click that file under **Staged Changes** to open its diff.
3. Run **Reopen Editor With…** and choose **Markdown Editor**.
4. Switch the mode pill from **Locked** to **Editing**, then type some text.

## Actual

The editor accepts the typing and displays the new text, even though it is showing the staged revision of the file, which is read-only everywhere else in VS Code.

The text then behaves oddly:

- `git diff --cached` never shows it. The staged content does not change.
- It stays visible for as long as the file remains staged, and appears again in any other editor opened on that staged revision.
- Unstaging the file makes it disappear.

## Expected

The Markdown editor refuses the edit, the way the text editor already does on the same staged revision.

## Impact

While the file stays staged, what the editor shows is no longer what is actually staged, and nothing signals it. The file can then be committed with content that differs from what was reviewed.

## Related

#199251 looks similar: staged content could be edited in the multi-diff editor, with the edit living only in the editor.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.