summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Kearns <dougkearns@gmail.com>2009-06-04 14:28:32 +1000
committerDoug Kearns <dougkearns@gmail.com>2009-06-04 14:28:32 +1000
commite762b6f9d457459da647b3a3eba189cdd8a4465c (patch)
tree8797c566534b5ac816e73c2884c97f2cf1e3da6b
parent4df596d96963cd6a4ca499891778c58c1f9f4bfa (diff)
downloadpentadactyl-e762b6f9d457459da647b3a3eba189cdd8a4465c.tar.gz
Add a -description option to :command.
-rw-r--r--common/content/commands.js12
-rw-r--r--vimperator/NEWS3
-rw-r--r--vimperator/locale/en-US/map.txt6
-rw-r--r--xulmus/locale/en-US/map.txt6
4 files changed, 21 insertions, 6 deletions
diff --git a/common/content/commands.js b/common/content/commands.js
index 69ada697..0b2b1366 100644
--- a/common/content/commands.js
+++ b/common/content/commands.js
@@ -1018,10 +1018,11 @@ function Commands() //{{{
if (args.literalArg)
{
- let nargsOpt = args["-nargs"] || "0";
- let bangOpt = "-bang" in args;
- let countOpt = "-count" in args;
- let completeOpt = args["-complete"];
+ let nargsOpt = args["-nargs"] || "0";
+ let bangOpt = "-bang" in args;
+ let countOpt = "-count" in args;
+ let descriptionOpt = args["-description"] || "User-defined command";
+ let completeOpt = args["-complete"];
let completeFunc = null; // default to no completion for user commands
@@ -1054,7 +1055,7 @@ function Commands() //{{{
}
let added = commands.addUserCommand([cmd],
- "User defined command",
+ descriptionOpt,
userCommand,
{
argCount: nargsOpt,
@@ -1106,6 +1107,7 @@ function Commands() //{{{
function (arg) /^[01*?+]$/.test(arg), ["0", "1", "*", "?", "+"]],
[["-bang"], self.OPTION_NOARG],
[["-count"], self.OPTION_NOARG],
+ [["-description"], self.OPTION_STRING],
// TODO: "E180: invalid complete value: " + arg
[["-complete"], self.OPTION_STRING,
function (arg) arg in completeOptionMap || /custom,\w+/.test(arg),
diff --git a/vimperator/NEWS b/vimperator/NEWS
index 8bd34a02..59d4c063 100644
--- a/vimperator/NEWS
+++ b/vimperator/NEWS
@@ -2,9 +2,10 @@
* version 2.2a1pre
* IMPORTANT: shifted key notation now matches Vim's behaviour. E.g. <C-a>
and <C-A> are equivalent, to map the uppercase character use <C-S-A>.
+ * add -description option to :command
* command-line options are now supported via the host application's
-liberator option
- * add :i and :I for opening image location (in new tab)
+ * add ;i and ;I for opening image location (in new tab)
* add all.html to show all help sections in a single page - available via
:help all
* add ;c extended hint mode - open the context menu
diff --git a/vimperator/locale/en-US/map.txt b/vimperator/locale/en-US/map.txt
index b548e9a9..c8ceac44 100644
--- a/vimperator/locale/en-US/map.txt
+++ b/vimperator/locale/en-US/map.txt
@@ -375,6 +375,12 @@ By default a user command does not have a special version, i.e. a version
executed with the ! modifier. Providing the -bang attribute will enable this
and <bang> will be available in the argument.
+|:command-description| +
+Command description
+
+The command's description text can be set with -description. Otherwise it will
+default to "User-defined command".
+
|:command-replacement-text| +
Replacement text
diff --git a/xulmus/locale/en-US/map.txt b/xulmus/locale/en-US/map.txt
index 79341a5f..aae4407b 100644
--- a/xulmus/locale/en-US/map.txt
+++ b/xulmus/locale/en-US/map.txt
@@ -375,6 +375,12 @@ By default a user command does not have a special version, i.e. a version
executed with the ! modifier. Providing the -bang attribute will enable this
and <bang> will be available in the argument.
+|:command-description| +
+Command description
+
+The command's description text can be set with -description. Otherwise it will
+default to "User-defined command".
+
|:command-replacement-text| +
Replacement text