diff --git a/lib/ace/keybinding.js b/lib/ace/keybinding.js index 31df2ee3..d9ecd4a1 100644 --- a/lib/ace/keybinding.js +++ b/lib/ace/keybinding.js @@ -56,7 +56,7 @@ var KeyBinding = function(element, editor, config) { var commandName = (_self.config.reverse[hashId] || {})[(key || String.fromCharCode(e.keyCode)).toLowerCase()]; - var success = canon.exec(commandName); + var success = canon.exec(commandName, {editor: editor}); if (success) { return event.stopEvent(e); } diff --git a/plugins/cockpit/cli.js b/plugins/cockpit/cli.js index 027ba9f8..85382cb9 100644 --- a/plugins/cockpit/cli.js +++ b/plugins/cockpit/cli.js @@ -244,8 +244,10 @@ exports.Assignment = Assignment; * class * @constructor */ -function Requisition() { +function Requisition(env) { + this.env = env; } + Requisition.prototype = { /** * The command that we are about to execute. @@ -377,7 +379,9 @@ exports.Requisition = Requisition; * if not specified. * @constructor */ -function CliRequisition(options) { +function CliRequisition(env, options) { + Requisition.call(this, env); + if (options && options.flags) { /** * TODO: We were using a default of keyboard.buildFlags({ }); diff --git a/plugins/pilot/canon.js b/plugins/pilot/canon.js index aa308f49..5bf4e79a 100644 --- a/plugins/pilot/canon.js +++ b/plugins/pilot/canon.js @@ -37,7 +37,6 @@ define(function(require, exports, module) { - var console = require('pilot/console'); var Trace = require('pilot/stacktrace').Trace; var oop = require('pilot/oop').oop; @@ -70,11 +69,8 @@ var commandExtensionSpec = { indexOn: 'name' }; -var env; - exports.startup = function(data, reason) { // TODO: this is probably all kinds of evil, but we need something working - env = data.env; catalog.addExtensionSpec(commandExtensionSpec); }; @@ -160,7 +156,7 @@ exports.getCommandNames = function() { * everything it needs to about the command params * @param command Either a command, or the name of one */ -exports.exec = function(command, args) { +exports.exec = function(command, env, args) { if (typeof command === 'string') { command = commands[command]; }