Skip to content

EditHistory

Defined in: extensions/commands.ts:382

EditHistory(editor, options): any

Defined in: extensions/commands.ts:382

PrismEditor<{ }>

EditorOptions

any

clear(): void

Defined in: extensions/commands.ts:384

Clears the history stack. Usually wanted after changing the value of the editor.

void


go(offset): void

Defined in: extensions/commands.ts:395

Sets the active entry relative to the current entry.

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.

void


has(offset): boolean

Defined in: extensions/commands.ts:403

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.

number

boolean