1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 13:52:26 +01:00

display the user command's definition in the list output of :command

This commit is contained in:
Doug Kearns
2008-08-08 10:03:04 +00:00
parent 874d94e7eb
commit 316bad4587

View File

@@ -77,7 +77,9 @@ liberator.Command = function (specs, description, action, extraInfo) //{{{
this.completer = extraInfo.completer || null; this.completer = extraInfo.completer || null;
this.options = extraInfo.options || []; this.options = extraInfo.options || [];
this.argCount = extraInfo.argCount || ""; this.argCount = extraInfo.argCount || "";
this.isUserCommand = extraInfo.isUserCommand || false; this.isUserCommand = extraInfo.isUserCommand || false;
this.replacementText = extraInfo.replacementText || null;
}; };
liberator.Command.prototype = { liberator.Command.prototype = {
@@ -651,7 +653,7 @@ liberator.Commands = function () //{{{
var replaced = rep.replace("<args>", args).replace("<lt>", "<"); var replaced = rep.replace("<args>", args).replace("<lt>", "<");
liberator.execute(replaced); liberator.execute(replaced);
}, },
null, special)) { replacementText: rep }, special))
{ {
liberator.echoerr("E174: Command already exists: add ! to replace it"); 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()) + "<br/>" + var str = ":" + liberator.util.escapeHTML(liberator.commandline.getCommand()) + "<br/>" +
"<table><tr align=\"left\" class=\"hl-Title\"><th>Name</th><th>Args</th><th>Definition</th></tr>"; "<table><tr align=\"left\" class=\"hl-Title\"><th>Name</th><th>Args</th><th>Definition</th></tr>";
for (var i = 0; i < cmdlist.length; i++) for (var i = 0; i < cmdlist.length; i++)
str += "<tr><td>" + cmdlist[i].name + "</td><td>" + "*" + "</td><td>" + "...definition not implemented yet" + "</td></tr>"; str += "<tr><td>" + cmdlist[i].name + "</td><td>" + "*" + "</td><td>" + liberator.util.escapeHTML(cmdlist[i].replacementText) + "</td></tr>";
str += "</table>"; str += "</table>";
liberator.commandline.echo(str, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE); liberator.commandline.echo(str, liberator.commandline.HL_NORMAL, liberator.commandline.FORCE_MULTILINE);
} }