mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 17:42:27 +01:00
add :optionusage command
This commit is contained in:
1
NEWS
1
NEWS
@@ -7,6 +7,7 @@
|
|||||||
special versions for the old behavior
|
special versions for the old behavior
|
||||||
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
|
||||||
VimperatorLeave respectively
|
VimperatorLeave respectively
|
||||||
|
* add :optionusage
|
||||||
* add :doautocmd and :doautoall
|
* add :doautocmd and :doautoall
|
||||||
* add :style and :delstyle commands
|
* add :style and :delstyle commands
|
||||||
* add DOMLoad autocmd event
|
* add DOMLoad autocmd event
|
||||||
|
|||||||
@@ -349,6 +349,34 @@ const liberator = (function () //{{{
|
|||||||
bangAllowed: true
|
bangAllowed: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
liberator.commands.add(["optionu[sage]"],
|
||||||
|
"List all options with a short description",
|
||||||
|
function (args, special)
|
||||||
|
{
|
||||||
|
if (!special)
|
||||||
|
{
|
||||||
|
liberator.help("option-index");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: clicking on these should open the help
|
||||||
|
var usage = <table>
|
||||||
|
{
|
||||||
|
liberator.template.map(liberator.options, function (option)
|
||||||
|
<tr>
|
||||||
|
<td class="hl-Title" style="padding-right: 20px">{option.name}</td>
|
||||||
|
<td>{option.description}</td>
|
||||||
|
</tr>)
|
||||||
|
}
|
||||||
|
</table>;
|
||||||
|
liberator.echo(usage, liberator.commandline.FORCE_MULTILINE);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
argCount: "0",
|
||||||
|
bangAllowed: true
|
||||||
|
});
|
||||||
|
|
||||||
liberator.commands.add(["q[uit]"],
|
liberator.commands.add(["q[uit]"],
|
||||||
liberator.has("tabs") ? "Quit current tab" : "Quit application",
|
liberator.has("tabs") ? "Quit current tab" : "Quit application",
|
||||||
function (args, special)
|
function (args, special)
|
||||||
|
|||||||
@@ -862,8 +862,9 @@ liberator.Options = function () //{{{
|
|||||||
|
|
||||||
__iterator__: function ()
|
__iterator__: function ()
|
||||||
{
|
{
|
||||||
for (let i = 0; i < options.length; i++)
|
let sorted = options.sort(function (opt1, opt2) opt1.name > opt2.name);
|
||||||
yield options[i];
|
for (let i = 0; i < sorted.length; i++)
|
||||||
|
yield sorted[i];
|
||||||
},
|
},
|
||||||
|
|
||||||
add: function (names, description, type, defaultValue, extraInfo)
|
add: function (names, description, type, defaultValue, extraInfo)
|
||||||
|
|||||||
@@ -60,16 +60,24 @@ ____________________________________________________________________________
|
|||||||
|:exu| |:exusage| +
|
|:exu| |:exusage| +
|
||||||
||:exu[sage][!]||
|
||:exu[sage][!]||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
Show help on Ex commands. Added to simulate the Nvi command. If [!] is given
|
Show help on Ex commands. If [!] is given then the help is listed in the
|
||||||
then the help is listed in the command output window.
|
command output window.
|
||||||
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|:optionu| |:optionusage| +
|
||||||
|
||:optionu[sage][!]||
|
||||||
|
________________________________________________________________________________
|
||||||
|
Show help on options. If [!] is given then the help is listed in the command
|
||||||
|
output window.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|:viu| |:viusage| +
|
|:viu| |:viusage| +
|
||||||
||:viu[sage][!]||
|
||:viu[sage][!]||
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
Show help on Normal mode commands. Added to simulate the Nvi command. If [!] is
|
Show help on Normal mode commands. If [!] is given then the help is listed in
|
||||||
given then the help is listed in the command output window.
|
the command output window.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user