We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a0d51e8 commit a84cd4aCopy full SHA for a84cd4a
app/src/protyle/undo/index.ts
@@ -68,6 +68,12 @@ export class Undo {
68
}
69
70
public replace(doOperations: IOperation[]) {
71
+ // undo 引发 replace 导致 stack 错误 https://github.com/siyuan-note/siyuan/issues/9178
72
+ if (this.hasUndo && this.redoStack.length > 0) {
73
+ this.undoStack.push(this.redoStack.pop())
74
+ this.redoStack = [];
75
+ this.hasUndo = false;
76
+ }
77
if (this.undoStack.length > 0) {
78
this.undoStack[this.undoStack.length - 1].doOperations = doOperations;
79
0 commit comments