Skip to content

Commit 4d0e99d

Browse files
committed
Make sure clearHistory clears all linked histories
Closes #6108
1 parent a41ea1b commit 4d0e99d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/model/Doc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ Doc.prototype = createObj(BranchChunk.prototype, {
197197
for (let i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone
198198
return {undo: done, redo: undone}
199199
},
200-
clearHistory: function() {this.history = new History(this.history.maxGeneration)},
200+
clearHistory: function() {
201+
this.history = new History(this.history.maxGeneration)
202+
linkedDocs(this, doc => doc.history = this.history, true)
203+
},
201204

202205
markClean: function() {
203206
this.cleanGeneration = this.changeGeneration(true)

0 commit comments

Comments
 (0)