Skip to content

Commit

Permalink
Make sure clearHistory clears all linked histories
Browse files Browse the repository at this point in the history
Closes #6108
  • Loading branch information
marijnh committed Jan 9, 2020
1 parent a41ea1b commit 4d0e99d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/model/Doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,10 @@ Doc.prototype = createObj(BranchChunk.prototype, {
for (let i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone
return {undo: done, redo: undone}
},
clearHistory: function() {this.history = new History(this.history.maxGeneration)},
clearHistory: function() {
this.history = new History(this.history.maxGeneration)
linkedDocs(this, doc => doc.history = this.history, true)
},

markClean: function() {
this.cleanGeneration = this.changeGeneration(true)
Expand Down

0 comments on commit 4d0e99d

Please sign in to comment.