Skip to content
Anjunar/ DOCS

History

Undo and redo restore document and selection together; a group can combine related commits into one step.

Concept

One author action

The History extension contributes Undo and Redo commands. Browser input groups composition events so an input method does not require many undo presses.

Make and undo a change

Type or format text, then use the History buttons or Ctrl+Z and Ctrl+Shift+Z.

Edit this sentence and undo your change.

7 words · 5 nodes
Edit this **sentence** and undo your change.
Source

History commands

History is installed with the editor extensions; commands are ordinary typed dispatches.

scala
val history = new History(HistoryConfig.default) val resolved = ExtensionResolver.resolve(Vector(RichText(generator), history)) session.dispatch(HistoryCommands.Undo) session.dispatch(HistoryCommands.Redo) val canUndo = history.canUndo val canRedo = history.canRedo