Fixes #131
An inconsistency in the two ways to declare ace commands caused a failure in re-binding certain keys. Switched all default configs to the shorter syntax, just in case.
This commit is contained in:
parent
2ad896f512
commit
b9252f9b41
2 changed files with 14 additions and 14 deletions
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue