mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 23:17:59 +01:00
make sure [!] is highlighted properly in the help page for all command usage
synopses
This commit is contained in:
@@ -388,7 +388,7 @@ function Commands() //{{{
|
||||
vimperator.marks.remove(args, special);
|
||||
},
|
||||
{
|
||||
usage: ["delm[arks]! {marks}"],
|
||||
usage: ["delm[arks][!] {marks}"],
|
||||
short_help: "Delete the specified marks {a-zA-Z}",
|
||||
help: "Marks are presented as a list. Example:<br/>" +
|
||||
"<code class=\"command\">:delmarks Aa b p</code> will delete marks A, a, b and p<br/>" +
|
||||
|
||||
@@ -62,11 +62,13 @@ Vimperator.prototype.help = function(section, easter) //{{{
|
||||
usage = usage.replace(/</g, "<");
|
||||
usage = usage.replace(/>/g, ">");
|
||||
usage = usage.replace(/\\n/g, "<br/>");
|
||||
// color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now)
|
||||
usage = usage.replace(/(^|;|\n|\s|\]|\}|=|<br\/?>)({.*?}|\[.*?\])/gm, "$1<span class=\"argument\">$2</span>");
|
||||
// color {count}, [!], {arg} and [arg] in the usage, not nice and error prone but the regexp work (for now)
|
||||
usage = usage.replace(/({[^}]+})/g, "<span class=\"argument\">$1</span>"); // required args
|
||||
usage = usage.replace(/([^A-Za-z])(\[[^!\]]+\])/g, "$1<span class=\"argument\">$2</span>"); // optional args
|
||||
usage = usage.replace(/\[!\]/, "<span class=\"argument\">[!]</span>"); // special
|
||||
// and the 'option' in a different color
|
||||
usage = usage.replace(/^'(\w+)'/gm, "'<span class=\"option\">$1</span>'");
|
||||
ret += "<code>" +beg+ usage +end+ '</code><br/>';
|
||||
ret += "<code>" + beg + usage + end + '</code><br/>';
|
||||
}
|
||||
ret += '</td><td valign="top">';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user