Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UndoGroup

This class extends the vanilla UndoGroup class by recording the location of the caret when the group is created and when group recording ends. This allows restoring the caret to sensible positions before and after undoing or redoing.

Hierarchy

Index

Constructors

constructor

Properties

Protected _events

_events: Subject<UndoEvents> = new Subject()

Private caretAsPathAfter

caretAsPathAfter: Caret | undefined

Private caretAsPathBefore

caretAsPathBefore: Caret

desc

desc: string

Private editor

editor: Editor

events

events: Observable<UndoEvents> = this._events.asObservable()

Protected list

list: Undo[] = []

Methods

end

  • end(): void

getDataCaretAsPath

  • getDataCaretAsPath(): Caret

performRedo

  • performRedo(): void

performUndo

  • performUndo(): void

record

  • record(obj: Undo): void

recordCaretAfter

  • recordCaretAfter(): void
  • This method can be used to record the caret position after the acts recorded by this undo are performed. If the caret is recorded by means of this method, then end will not record the caret position again. This can be useful in cases for which it is not clear when an UndoGroup might end. TextUndoGroup is a case in point. This method can be called any number of times to update the caret position at the end of the group.

    Returns void

redo

  • redo(): void
  • Called when the operation must be redone.

    throws

    {Error} If an undo is attempted when an undo or redo is already in progress.

    Returns void

setDataCaretAsPath

  • setDataCaretAsPath(caret: Caret): void

toString

  • toString(): string

undo

  • undo(): void
  • Called when the operation must be undone.

    throws

    {Error} If an undo is attempted when an undo or redo is already in progress.

    Returns void

Generated using TypeDoc