MCPcopy Create free account
hub / github.com/SplootCode/splootcode / redo

Method redo

packages/editor/src/context/undoWatcher.ts:52–67  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

EditorClass · 0.80

Calls 1

Tested by

no test coverage detected