code.pyret.org icon indicating copy to clipboard operation
code.pyret.org copied to clipboard

disable undo keyboard shortcuts if in VScode mode

Open jpolitz opened this issue 3 months ago • 0 comments

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.

jpolitz avatar Sep 17 '25 15:09 jpolitz