From 699c20e077bcc5eb5198cbca8c263343c0adc351 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sat, 21 Jul 2007 14:12:12 +0000 Subject: [PATCH] make sure [!] is highlighted properly in the help page for all command usage synopses --- chrome/content/vimperator/commands.js | 2 +- chrome/content/vimperator/help.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 2d20e2ca..81364d63 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -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:
" + ":delmarks Aa b p will delete marks A, a, b and p
" + diff --git a/chrome/content/vimperator/help.js b/chrome/content/vimperator/help.js index 0dd70326..9fd80474 100644 --- a/chrome/content/vimperator/help.js +++ b/chrome/content/vimperator/help.js @@ -62,11 +62,13 @@ Vimperator.prototype.help = function(section, easter) //{{{ usage = usage.replace(//g, ">"); usage = usage.replace(/\\n/g, "
"); - // color {count} and [url] arguments in the usage, not nice and error prone but the regexp work (for now) - usage = usage.replace(/(^|;|\n|\s|\]|\}|=|)({.*?}|\[.*?\])/gm, "$1$2"); + // color {count}, [!], {arg} and [arg] in the usage, not nice and error prone but the regexp work (for now) + usage = usage.replace(/({[^}]+})/g, "$1"); // required args + usage = usage.replace(/([^A-Za-z])(\[[^!\]]+\])/g, "$1$2"); // optional args + usage = usage.replace(/\[!\]/, "[!]"); // special // and the 'option' in a different color usage = usage.replace(/^'(\w+)'/gm, "'$1'"); - ret += "" +beg+ usage +end+ '
'; + ret += "" + beg + usage + end + '
'; } ret += '';