1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-25 06:43:31 +01:00

Fix :set completion. Allow completing non-cannonical -options.

This commit is contained in:
Kris Maglione
2008-11-26 22:32:55 +00:00
parent 0adf03a6b8
commit 7fad219028
2 changed files with 4 additions and 4 deletions

View File

@@ -472,7 +472,7 @@ function Commands() //{{{
{ {
// Push possible option matches into completions // Push possible option matches into completions
if (complete && !onlyArgumentsRemaining) if (complete && !onlyArgumentsRemaining)
completeOpts = [[opt[0][0], opt[0][0]] for ([i, opt] in Iterator(options)) if (opt[0][0].indexOf(arg) == 0)]; completeOpts = [[opt[0], opt[0][0]] for ([i, opt] in Iterator(options))];
} }
function resetCompletions() function resetCompletions()
{ {

View File

@@ -665,7 +665,7 @@ function Options() //{{{
}, },
{ {
bang: true, bang: true,
completer: function (context, args) completer: function (context, args, modifiers)
{ {
let filter = context.filter; let filter = context.filter;
var optionCompletions = []; var optionCompletions = [];
@@ -688,7 +688,7 @@ function Options() //{{{
let prefix = (filter.match(/^(no|inv)/) || [""])[0]; let prefix = (filter.match(/^(no|inv)/) || [""])[0];
if (prefix) if (prefix)
filter = filter.substr(prefix.length); context.filter = filter = filter.substr(prefix.length);
let scope = modifiers && modifiers.scope || options.OPTION_SCOPE_BOTH; let scope = modifiers && modifiers.scope || options.OPTION_SCOPE_BOTH;
@@ -698,7 +698,7 @@ function Options() //{{{
if (filter.indexOf("=") == -1) if (filter.indexOf("=") == -1)
{ {
context.title = ["Option"]; context.title = ["Option"];
context.quote = function (name) prefix + name; context.quote = [prefix, util.identity, ""];
context.keys = { text: "names", description: "description" }; context.keys = { text: "names", description: "description" };
context.completions = [opt for (opt in opts)]; context.completions = [opt for (opt in opts)];
return; return;