make keybindings use the canon
This commit is contained in:
parent
efa5909c76
commit
a2cca9118e
1 changed files with 3 additions and 5 deletions
|
|
@ -41,7 +41,7 @@ var core = require("pilot/core").core;
|
|||
var event = require("pilot/event").event;
|
||||
var default_mac = require("ace/conf/keybindings/default_mac").bindings;
|
||||
var default_win = require("ace/conf/keybindings/default_win").bindings;
|
||||
var PluginManager = require("pilot/plugin_manager").PluginManager;
|
||||
var canon = require("pilot/canon");
|
||||
require("ace/commands/default_commands");
|
||||
|
||||
var KeyBinding = function(element, editor, config) {
|
||||
|
|
@ -55,11 +55,9 @@ var KeyBinding = function(element, editor, config) {
|
|||
|
||||
var commandName = (_self.config.reverse[hashId] || {})[(key
|
||||
|| String.fromCharCode(e.keyCode)).toLowerCase()];
|
||||
var command = PluginManager.commands[commandName];
|
||||
|
||||
if (command) {
|
||||
var env = { editor: editor, selection: editor.getSelection() };
|
||||
command(env);
|
||||
var success = canon.exec(commandName);
|
||||
if (success) {
|
||||
return event.stopEvent(e);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue