diff --git a/src/views/tool/components/codeEditor.vue b/src/views/tool/components/codeEditor.vue index e27fd73cb03fb4eeab30fd6d4d9f5548df33ed4d..6614391ae8665938e54f1dd8b1dcb0dfc0c3eb20 100644 --- a/src/views/tool/components/codeEditor.vue +++ b/src/views/tool/components/codeEditor.vue @@ -58,7 +58,17 @@ export default { watch: { value(newValue) { if (this.editor !== null && this.editor.getValue() !== newValue) { - this.editor.setValue(newValue) + this.editor.pushUndoStop(); + this.editor.getModel().pushEditOperations( + [], + [ + { + range: this.editor.getModel().getFullModelRange(), + text: newValue, + }, + ] + ); + this.editor.pushUndoStop(); } }, language(newValue) {