Agents window Markdown editor: Empty paragraphs exist only as transient view state
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Testing #326540
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version: Insiders with the experimental Markdown editor
- OS Version: macOS
- Audited package revision: microsoft/vscode-packages@1d81418d61ad769f154579196a51a9364c105e2d
### Steps to Reproduce
1. Open a Markdown document containing `Hello`.
2. Put the caret at the end.
3. Press Enter.
4. Before typing another character, navigate with ArrowUp, press Escape, or otherwise leave the apparent empty paragraph.
### Expected
Enter applies an observable document edit immediately. Dirty state, save, undo, selection, and integrations all see the same new-line state that is rendered to the user.
### Actual
The source remains `Hello`; the new paragraph exists only as transient view state. Navigation cancels it without changing the document.
### Impact
The editor displays an edit that is not yet part of the document. Saving immediately after Enter does not persist what the user sees, navigation can silently discard it, and features that consume source text or selection can disagree with the rendered editor. This transient state also contributes to inconsistent commands such as Select All.
Contributor guide
Assessment
This issue has not been assessed yet.