code.pyret.org
code.pyret.org copied to clipboard
disable undo keyboard shortcuts if in VScode mode
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.