add keys to history

This commit is contained in:
Philipp Kühn
2020-04-02 13:36:18 +02:00
parent 7710859f38
commit 2ef2b09c0d

View File

@@ -10,7 +10,7 @@ import {
declare module '@tiptap/core/src/Editor' { declare module '@tiptap/core/src/Editor' {
interface Editor { interface Editor {
undo(): Editor, undo(): Editor,
undo(): Editor, redo(): Editor,
} }
} }
@@ -30,6 +30,14 @@ export default class History extends Extension {
}) })
} }
keys() {
return {
'Mod-z': () => this.editor.undo(),
'Mod-y': () => this.editor.redo(),
'Shift-Mod-z': () => this.editor.redo(),
}
}
plugins() { plugins() {
return [ return [
history() history()