From 2ef2b09c0ddc588434190f637ef4c7d69ce9eac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Thu, 2 Apr 2020 13:36:18 +0200 Subject: [PATCH] add keys to history --- packages/extension-history/index.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/extension-history/index.ts b/packages/extension-history/index.ts index df55bcca..83f7c1fd 100644 --- a/packages/extension-history/index.ts +++ b/packages/extension-history/index.ts @@ -10,7 +10,7 @@ import { declare module '@tiptap/core/src/Editor' { interface 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() { return [ history()