diff --git a/config/keys.json b/config/keys.json index 5205500..92a227e 100644 --- a/config/keys.json +++ b/config/keys.json @@ -11,18 +11,18 @@ //Chromebook fixes "Ctrl-Up": { "ace": "addCursorAbove" }, "Ctrl-Down": { "ace": "addCursorBelow" }, - "Ctrl-Home": { "command": "ace:command", "argument": "gotostart" }, - "Ctrl-End": { "command": "ace:command", "argument": "gotoend" }, - "Ctrl-PageUp": { "command": "ace:command", "argument": "gotostart" }, - "Ctrl-PageDown": { "command": "ace:command", "argument": "gotoend" }, - "Alt-PageDown": { "command": "ace:command", "argument": "gotopagedown" }, - "PageDown": { "command": "ace:command", "argument": "gotopagedown" }, - "Alt-PageUp": { "command": "ace:command", "argument": "gotopageup" }, - "PageUp": {"command": "ace:command", "argument": "gotopageup" }, - "Alt-Home": { "command": "ace:command", "argument": "gotolinestart" }, - "Home": { "command": "ace:command", "argument": "gotolinestart" }, - "Alt-End": { "command": "ace:command", "argument": "gotolineend" }, - "End": { "command": "ace:command", "argument": "gotolineend" }, + "Ctrl-Home": { "ace": "gotostart" }, + "Ctrl-End": { "ace": "gotoend" }, + "Ctrl-PageUp": { "ace": "gotostart" }, + "Ctrl-PageDown": { "ace": "gotoend" }, + "Alt-PageDown": { "ace": "gotopagedown" }, + "PageDown": { "ace": "gotopagedown" }, + "Alt-PageUp": { "ace": "gotopageup" }, + "PageUp": {"ace": "gotopageup" }, + "Alt-Home": { "ace": "gotolinestart" }, + "Home": { "ace": "gotolinestart" }, + "Alt-End": { "ace": "gotolineend" }, + "End": { "ace": "gotolineend" }, //Sublime compatibility "Ctrl-L": "sublime:expand-to-line", diff --git a/js/ui/keys.js b/js/ui/keys.js index bda463f..2d006a9 100644 --- a/js/ui/keys.js +++ b/js/ui/keys.js @@ -42,7 +42,7 @@ define([ return converted; }; - //need to remove existing Ace conflicts + //need to auto-bind Ace keys, remove Ace conflicts var bindAce = function() { var handler = new AceCommandManager("win", defaultAceCommands); editor.setKeyboardHandler(handler); @@ -50,7 +50,7 @@ define([ for (var k in bindings) { var action = bindings[k]; //if (!action.ace) continue; - handler.bindKey(k, action.ace); + handler.bindKey(k, action.command == "ace:command" ? action.argument : action.ace); } }; command.on("init:startup", bindAce);