1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 14:02:28 +01:00

Give :pageinfo an optional argument. Add completion.optionValue.

This commit is contained in:
Kris Maglione
2008-11-28 08:13:39 +00:00
parent a86af802c5
commit 9415926d75
4 changed files with 67 additions and 53 deletions

View File

@@ -490,8 +490,15 @@ function Buffer() //{{{
commands.add(["pa[geinfo]"],
"Show various page information",
function () { buffer.showPageInfo(true); },
{ argCount: "0" });
function (args) { buffer.showPageInfo(true, args[0]); },
{
argCount: "?",
completer: function (context)
{
context.title = ["Page Info"];
completion.optionValue(context, "pageinfo", "+", "");
}
});
commands.add(["pagest[yle]"],
"Select the author style sheet to apply",
@@ -1263,7 +1270,7 @@ function Buffer() //{{{
liberator.echo(<>Element:<br/>{util.objectToString(elem, true)}</>, commandline.FORCE_MULTILINE);
},
showPageInfo: function (verbose)
showPageInfo: function (verbose, sections)
{
// Ctrl-g single line output
if (!verbose)
@@ -1283,7 +1290,7 @@ function Buffer() //{{{
return;
}
let option = options["pageinfo"];
let option = sections || options["pageinfo"];
let list = template.map(option, function (option) {
let opt = pageInfo[option];
if (opt)