From 8ad1377e2abec6c37a6263c32a57a44e8099c177 Mon Sep 17 00:00:00 2001 From: Cory Forsyth Date: Fri, 19 Feb 2016 15:30:57 -0500 Subject: [PATCH] Add ctrl+z, ctrl+shift+z key commands for non-mac --- src/js/editor/key-commands.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/js/editor/key-commands.js b/src/js/editor/key-commands.js index 6fb77b272..5e63eb8a6 100644 --- a/src/js/editor/key-commands.js +++ b/src/js/editor/key-commands.js @@ -56,9 +56,7 @@ export const DEFAULT_KEY_COMMANDS = [{ }, { str: 'CTRL+A', run(editor) { - if (!Browser.isMac) { - return false; - } + if (!Browser.isMac) { return false; } let {range} = editor; let {head: {section}} = range; editor.run(postEditor => { @@ -68,9 +66,7 @@ export const DEFAULT_KEY_COMMANDS = [{ }, { str: 'CTRL+E', run(editor) { - if (!Browser.isMac) { - return false; - } + if (!Browser.isMac) { return false; } let {range} = editor; let {tail: {section}} = range; editor.run(postEditor => { @@ -118,6 +114,18 @@ export const DEFAULT_KEY_COMMANDS = [{ postEditor.redoLastChange(); }); } +}, { + str: 'CTRL+Z', + run(editor) { + if (Browser.isMac) { return false; } + editor.run(postEditor => postEditor.undoLastChange()); + } +}, { + str: 'CTRL+SHIFT+Z', + run(editor) { + if (Browser.isMac) { return false; } + editor.run(postEditor => postEditor.redoLastChange()); + } }]; function modifierNamesToMask(modiferNames) {