diff --git a/content/commands.js b/content/commands.js index 72ddcf5a..8ea368b7 100644 --- a/content/commands.js +++ b/content/commands.js @@ -70,14 +70,16 @@ liberator.Command = function (specs, description, action, extraInfo) //{{{ this.longNames = expandedSpecs.longNames; // return the primary command name (the long name of the first spec listed) - this.name = this.longNames[0]; - this.names = expandedSpecs.names; // return all command name aliases - this.description = description || ""; - this.action = action; - this.completer = extraInfo.completer || null; - this.options = extraInfo.options || []; - this.argCount = extraInfo.argCount || ""; - this.isUserCommand = extraInfo.isUserCommand || false; + this.name = this.longNames[0]; + this.names = expandedSpecs.names; // return all command name aliases + this.description = description || ""; + this.action = action; + this.completer = extraInfo.completer || null; + this.options = extraInfo.options || []; + this.argCount = extraInfo.argCount || ""; + + this.isUserCommand = extraInfo.isUserCommand || false; + this.replacementText = extraInfo.replacementText || null; }; liberator.Command.prototype = { @@ -651,7 +653,7 @@ liberator.Commands = function () //{{{ var replaced = rep.replace("", args).replace("", "<"); liberator.execute(replaced); }, - null, special)) + { replacementText: rep }, special)) { liberator.echoerr("E174: Command already exists: add ! to replace it"); } @@ -664,7 +666,7 @@ liberator.Commands = function () //{{{ var str = ":" + liberator.util.escapeHTML(liberator.commandline.getCommand()) + "
" + ""; for (var i = 0; i < cmdlist.length; i++) - str += ""; + str += ""; str += "
NameArgsDefinition
" + cmdlist[i].name + "" + "*" + "" + "...definition not implemented yet" + "
" + cmdlist[i].name + "" + "*" + "" + liberator.util.escapeHTML(cmdlist[i].replacementText) + "
"; liberator.commandline.echo(str, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE); }