Synchronize Monaco Editor-based custom editor undo stack with VS Code #2990
Unanswered
lppedd
asked this question in
Extension Development QnA
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We are using the standalone package of Monaco Editor for some of our custom editor webviews. The major problem I see is being able to emit the correct
CustomDocumentEditEventso that the undo and redo source of truth is VS Code, and not Monaco Editor.Is there an existing strategy for this specific use case?
Currently, what I may try out is having my own stack strategy:
onDidChangeModelContenteventseditorModel.pushStackElement()and find out how many entries are present in the stack by checkingundoRedoService._editStacks.get(key)._pastCustomDocumentEditEventwith the entry count forundoRedoService._editStacks.get(key)._pastundon-times based on the entry count.The same should probably apply for redos.
Beta Was this translation helpful? Give feedback.
All reactions