Added ability to fire Ace commands directly from keys.json, will be useful for Sublime bindings. Fixes #8. Still need to unbind these commands on startup, or they won't take effect.
This commit is contained in:
parent
218e993298
commit
af0e0bb743
1 changed files with 5 additions and 0 deletions
|
@ -14,6 +14,8 @@ define(["settings!keys", "command", "editor", "dom2"], function(Settings, comman
|
|||
40: "DOWN"
|
||||
};
|
||||
|
||||
//need to remove existing Ace conflicts on init:start
|
||||
|
||||
//we have to listen on keydown, because keypress will get caught by the window manager
|
||||
window.on("keydown", function(e) {
|
||||
var char = String.fromCharCode(e.keyCode);
|
||||
|
@ -34,6 +36,9 @@ define(["settings!keys", "command", "editor", "dom2"], function(Settings, comman
|
|||
command: action
|
||||
};
|
||||
}
|
||||
if (action.ace) {
|
||||
return editor.execCommand(action.ace);
|
||||
}
|
||||
command.fire(action.command, action.argument);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue