Skip to content

Commit

Permalink
Add ctrl+z, ctrl+shift+z key commands for non-mac
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Feb 19, 2016
1 parent 5af5b44 commit 8ad1377
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/js/editor/key-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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 => {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8ad1377

Please sign in to comment.