EditHistory
Defined in: extensions/commands.ts:392
Extends
Section titled “Extends”EditHistory(
editor,options):any
Defined in: extensions/commands.ts:392
Parameters
Section titled “Parameters”editor
Section titled “editor”PrismEditor<{ }>
options
Section titled “options”EditorOptions<{ }>
Returns
Section titled “Returns”any
Methods
Section titled “Methods”clear()
Section titled “clear()”clear():
void
Defined in: extensions/commands.ts:394
Clears the history stack. Usually wanted after changing the value of the editor.
Returns
Section titled “Returns”void
go(
offset):void
Defined in: extensions/commands.ts:405
Sets the active entry relative to the current entry.
Parameters
Section titled “Parameters”offset
Section titled “offset”number
The position you want to move to relative to the current entry.
EditHistory.go(-1) would be equivalent to an undo while EditHistory.go(1) would
be equivalent to a redo.
If there’s no entry at the specified offset, the call does nothing.
Returns
Section titled “Returns”void
has(
offset):boolean
Defined in: extensions/commands.ts:413
Returns whether or not there exists a history entry at the specified offset relative to the current entry.
This method can be used to determine whether a call to EditHistory.go with the same offset will succeed or do nothing.
Parameters
Section titled “Parameters”offset
Section titled “offset”number
Returns
Section titled “Returns”boolean