From f36d0848e1784b89227bae5584971b9f8f57280e Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 14 Sep 2008 15:26:54 +0000 Subject: [PATCH] change :viusage/:exusage to jump to the appropriate help tag - special versions now exhibit the old behaviour --- NEWS | 2 ++ content/liberator.js | 48 ++++++++++++++++++++++++++-------------- locale/en-US/various.txt | 10 +++++---- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/NEWS b/NEWS index bcb11dbe..9b6a642a 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@
 2008-XX-XX:
     * version 2.0 (probably)
+    * IMPORTANT: :viusage and :exusage now jump to the help index, use the
+      special versions for the old behavior
     * IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
       VimperatorLeave respectively
     * add :scriptnames
diff --git a/content/liberator.js b/content/liberator.js
index 451793dd..4dcdd6d0 100644
--- a/content/liberator.js
+++ b/content/liberator.js
@@ -266,18 +266,26 @@ const liberator = (function () //{{{
 
         liberator.commands.add(["exu[sage]"],
             "List all Ex commands with a short description",
-            function ()
+            function (args, special)
             {
-                var usage = "";
-                for (let command in liberator.commands)
+                if (!special)
                 {
-                    usage += "";
+                    liberator.help("ex-cmd-index");
                 }
-                usage += "
:" + - liberator.util.escapeHTML(command.name) + "" + - liberator.util.escapeHTML(command.description) + "
"; + else + { + // TODO: clicking on these should open the help + var usage = ""; + for (let command in liberator.commands) + { + usage += ""; + } + usage += "
:" + + liberator.util.escapeHTML(command.name) + "" + + liberator.util.escapeHTML(command.description) + "
"; - liberator.echo(usage, liberator.commandline.FORCE_MULTILINE); + liberator.echo(usage, liberator.commandline.FORCE_MULTILINE); + } }, { argCount: "0" }); @@ -479,18 +487,26 @@ const liberator = (function () //{{{ liberator.commands.add(["viu[sage]"], "List all mappings with a short description", - function (args, special, count, modifiers) + function (args, special) { - var usage = ""; - for (let mapping in liberator.mappings) + if (!special) { - usage += ""; + liberator.help("normal-index"); } - usage += "
" + - liberator.util.escapeHTML(mapping.names[0]) + "" + - liberator.util.escapeHTML(mapping.description) + "
"; + else + { + // TODO: clicking on these should open the help + var usage = ""; + for (let mapping in liberator.mappings) + { + usage += ""; + } + usage += "
" + + liberator.util.escapeHTML(mapping.names[0]) + "" + + liberator.util.escapeHTML(mapping.description) + "
"; - liberator.echo(usage, liberator.commandline.FORCE_MULTILINE); + liberator.echo(usage, liberator.commandline.FORCE_MULTILINE); + } }, { argCount: "0" }); } diff --git a/locale/en-US/various.txt b/locale/en-US/various.txt index 41e5e5f8..ea6dccca 100644 --- a/locale/en-US/various.txt +++ b/locale/en-US/various.txt @@ -58,16 +58,18 @@ ____________________________________________________________________________ |:exu| |:exusage| + -||:exu[sage]|| +||:exu[sage][!]|| ________________________________________________________________________________ -Show help on Ex commands. Added to simulate the Nvi command. +Show help on Ex commands. Added to simulate the Nvi command. If [!] is given +then the help is listed in the command output window. ________________________________________________________________________________ |:viu| |:viusage| + -||:viu[sage]|| +||:viu[sage][!]|| ________________________________________________________________________________ -Show help on Normal mode commands. Added to simulate the Nvi command. +Show help on Normal mode commands. Added to simulate the Nvi command. If [!] is +given then the help is listed in the command output window. ________________________________________________________________________________