beef up the canon for exec commands and the knowledge of the environment
This commit is contained in:
parent
9ee72169ac
commit
f6fa510708
1 changed files with 14 additions and 0 deletions
|
|
@ -68,7 +68,11 @@ 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);
|
||||
};
|
||||
|
||||
|
|
@ -105,6 +109,16 @@ exports.getCommands = function() {
|
|||
return Object.keys(commands);
|
||||
};
|
||||
|
||||
exports.exec = function(name) {
|
||||
var command = commands[name];
|
||||
if (command) {
|
||||
env.selection = env.editor.getSelection();
|
||||
command.exec(env);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* We publish a 'addedRequestOutput' event whenever new command begins output
|
||||
* TODO: make this more obvious
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue