Skip to content

Conversation

jpolitz
Copy link
Member

@jpolitz jpolitz commented Sep 17, 2025

VScode has its own definition of undo/redo that send direct updates to the TextDocument backing the editor.

If CodeMirror also listens to these, then they fight a bit; for example, the TextDocument updates, which tries to propagate its changes to the CodeMirror instance, which has just processed an undo, which then sends a message to update the TextDocument. This is especially bad for updates that undo to re-add text, because it can get interpreted as a double-insertion.

So, let VScode be in charge of these events only, and respect the TextDocument as the model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant