struct UndoStack
Swift
struct UndoStack
Undo/redo history for a single buffer.
Coalescing is deliberately time-free. A timer makes the split points depend on how fast someone types, which is both untestable and surprising ("why did that undo only half a word?"). Instead a run breaks on a word boundary, a direction change, or anything that is not a simple continuation — deterministic, and it matches where a user thinks a word ended.
Sources/LavaText/TextEdit.swift:66
Constructors
init()
Not documented.
Sources/LavaText/TextEdit.swift:70
Properties
var canRedo: Bool { get }
Not documented.
Sources/LavaText/TextEdit.swift:73
var canUndo: Bool { get }
Not documented.
Sources/LavaText/TextEdit.swift:72
Methods
mutating func clear()
Not documented.
Sources/LavaText/TextEdit.swift:99
mutating func popRedo() -> TextEdit?
Not documented.
Sources/LavaText/TextEdit.swift:93
mutating func popUndo() -> TextEdit?
Not documented.
Sources/LavaText/TextEdit.swift:87
mutating func record(_ edit: TextEdit)
Not documented.
Sources/LavaText/TextEdit.swift:75