Skip to content

Commit

Permalink
Clear undo history after opening file (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
shueja authored Apr 24, 2024
1 parent 4de6fb8 commit 6ce3fb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/document/DocumentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ export class DocumentManager {
const validationError = validate(parsed);
if (validationError.length == 0) {
this.model.fromSavedDocument(parsed);
// if we got this far, clear the undo history
this.model.document.history.clear();
} else {
throw `Invalid Document JSON: ${validationError}`;
}
Expand Down

0 comments on commit 6ce3fb4

Please sign in to comment.