()
| 50 | } |
| 51 | |
| 52 | redo() { |
| 53 | // No redo snapshots to use. |
| 54 | if (this.redoSnapshots.length == 0) { |
| 55 | return |
| 56 | } |
| 57 | // Remove current snapshot |
| 58 | const newSnapshot = this.redoSnapshots.shift() |
| 59 | // Put current snapshot on the undo stack |
| 60 | this.undoSnapshots.unshift(this.currentSnapshot) |
| 61 | this.currentSnapshot = newSnapshot |
| 62 | |
| 63 | // Disable undo shapshotting (but not other mutation firing) and recursively apply the snapshot as edits. |
| 64 | this.enabled = false |
| 65 | this.rootNode.applySerializedSnapshot(this.currentSnapshot) |
| 66 | this.enabled = true |
| 67 | } |
| 68 | |
| 69 | setRootNode(rootNode: SplootNode) { |
| 70 | this.rootNode = rootNode |
no test coverage detected