Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
undo(n = 1) {
for (let i = 0; i < n; i += 1) {
undo(this.state, tr => this.apply(tr));
}
return this;
}
enable: state => undo(state),
icon: icons.undo
select: state => undo(state),
icon: ""
[`${mod}-Z`]: () => undo(view.state, view.dispatch),
[`Shift-${mod}-Z`]: () => redo(view.state, view.dispatch),
execute = (
state: EditorState,
dispatch: ?(tr: Transform) => void,
view: ?EditorView
): boolean => {
return undo(state, dispatch);
};
}
"Mod-z": () => undo(this.outerView.state, this.outerView.dispatch),
"Mod-y": () => redo(this.outerView.state, this.outerView.dispatch)
"Mod-z": (state, dispatch) => undo(state, dispatch)
});
[`${mod}-Z`]: () => undo(view.state, view.dispatch),
[`Shift-${mod}-Z`]: () => redo(view.state, view.dispatch),
undo = () => {
const { pmstate } = this.props;
const { state, dispatch } = pmstate.pmview;
undo(state, dispatch);
};
doUndo(e: CustomEvent) {
e.stopPropagation()
e.preventDefault()
if (this.editorView) {
undo(this.editorView.state, this.editorView.dispatch)
this.editorView.focus()
}
}