diff --git a/platform/src/Panel.js b/platform/src/Panel.js index 69e351a..66f63ac 100644 --- a/platform/src/Panel.js +++ b/platform/src/Panel.js @@ -26,6 +26,9 @@ class Panel { } else { this.editor = editor; } + + // Reset undo manager + this.editor.session.getUndoManager().reset(); this.visible = true; } @@ -73,7 +76,10 @@ class Panel { * @returns a promise */ save(fileHandler) { - return fileHandler.storeFile(this.getFileUrl(), this.getValueSha(), this.getValue()); + let thisEditor = this.editor; + return fileHandler.storeFile(this.getFileUrl(), this.getValueSha(), this.getValue()) + // Mark the editor clean if the save completed + .then((response) => { thisEditor.session.getUndoManager().markClean(); }); } getEditor() {