1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 04:07:59 +01:00

change {count} to [count] in the usage strings since specifying a count is

always optional
This commit is contained in:
Doug Kearns
2007-08-08 05:46:40 +00:00
parent c615dc958c
commit 00b76309a3
3 changed files with 18 additions and 22 deletions

View File

@@ -62,10 +62,10 @@ vimperator.help = function(section, easter) //{{{
usage = usage.replace(/</g, "&lt;");
usage = usage.replace(/>/g, "&gt;");
usage = usage.replace(/\\n/g, "<br/>");
// 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
// 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/>';