UndoState

semagrams.util.UndoState
case class UndoState[A](recording: Boolean, past: List[A], present: A, future: List[A])

The internal state of an UndoableVar, implemented as a cursor into a list.

Attributes

future

states that we have undone (for redo). This goes away once you start editing from a state in the past; we don't have undo trees yet.

past

previous states (for undoing)

present

current state

recording

indicator for whether we should record updates or not

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def redo(): UndoState[A]

Attempt to go one step forward into states we have previously undone, remaining the same if no such states exist

Attempt to go one step forward into states we have previously undone, remaining the same if no such states exist

Attributes

def save(): UndoState[A]

Copy the present state onto the undo stack

Copy the present state onto the undo stack

Attributes

def undo(): UndoState[A]

Attempt to go one step back into history, remaining the same if there is no history

Attempt to go one step back into history, remaining the same if there is no history

Attributes

def update(a: A): UndoState[A]

Update the state, saving the previous state if recording is true

Update the state, saving the previous state if recording is true

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product