mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 11:48:00 +01:00
Fix some completion bugs
This commit is contained in:
@@ -534,9 +534,9 @@ function Commands() //{{{
|
|||||||
|
|
||||||
if (complete)
|
if (complete)
|
||||||
{
|
{
|
||||||
args.completeStart += optname.length + count;
|
|
||||||
if (quote || !invalid && count)
|
if (quote || !invalid && count)
|
||||||
{
|
{
|
||||||
|
args.completeStart += optname.length + 1;
|
||||||
args.completeOpt = opt[0][0];
|
args.completeOpt = opt[0][0];
|
||||||
args.quote = quoteArg[quote] || quoteArg[""];
|
args.quote = quoteArg[quote] || quoteArg[""];
|
||||||
if (typeof opt[3] == "function")
|
if (typeof opt[3] == "function")
|
||||||
|
|||||||
@@ -1080,12 +1080,12 @@ function Completion() //{{{
|
|||||||
if (args)
|
if (args)
|
||||||
{
|
{
|
||||||
// XXX, XXX, XXX
|
// XXX, XXX, XXX
|
||||||
|
let argContext = context.fork("args", args.completeStart);
|
||||||
compObject = command.completer.call(command, context, args, special, count);
|
compObject = command.completer.call(command, context, args, special, count);
|
||||||
if (compObject instanceof Array) // for now at least, let completion functions return arrays instead of objects
|
if (compObject instanceof Array) // for now at least, let completion functions return arrays instead of objects
|
||||||
compObject = { start: compObject[0], items: compObject[1] };
|
compObject = { start: compObject[0], items: compObject[1] };
|
||||||
if (args.completions)
|
if (args.completions)
|
||||||
{
|
{
|
||||||
let argContext = context.fork("args", args.completionStart);
|
|
||||||
argContext.title = [args.completeOpt || "Options"];
|
argContext.title = [args.completeOpt || "Options"];
|
||||||
argContext.items = args.completions;
|
argContext.items = args.completions;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -688,6 +688,7 @@ function Options() //{{{
|
|||||||
bang: true,
|
bang: true,
|
||||||
completer: function (context, args, special, count, modifiers)
|
completer: function (context, args, special, count, modifiers)
|
||||||
{
|
{
|
||||||
|
let filter = context.filter;
|
||||||
var optionCompletions = [];
|
var optionCompletions = [];
|
||||||
|
|
||||||
if (special) // list completions for about:config entries
|
if (special) // list completions for about:config entries
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ liberator.registerObserver("load_commands", function ()
|
|||||||
compl.push([content.location.href, "Current URL"]);
|
compl.push([content.location.href, "Current URL"]);
|
||||||
}
|
}
|
||||||
catch (e) {}
|
catch (e) {}
|
||||||
comp = compl.concat([[s, ""] for each (s in styles.sites)])
|
compl = compl.concat([[s, ""] for each (s in styles.sites)])
|
||||||
return [0, completion.filter(compl, args.arguments[0])];
|
return [0, completion.filter(compl, args.arguments[0])];
|
||||||
}
|
}
|
||||||
return [0, []];
|
return [0, []];
|
||||||
|
|||||||
@@ -314,7 +314,7 @@ function CommandLine() //{{{
|
|||||||
// TODO: doesn't belong in ui.js
|
// TODO: doesn't belong in ui.js
|
||||||
options.add(["complete", "cpt"],
|
options.add(["complete", "cpt"],
|
||||||
"Items which are completed at the :[tab]open prompt",
|
"Items which are completed at the :[tab]open prompt",
|
||||||
"charlist", "sfbh",
|
"charlist", "sfl",
|
||||||
{
|
{
|
||||||
completer: function (filter)
|
completer: function (filter)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user