mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-12 23:15:46 +01:00
add commandline completion to 'defsearch'
This commit is contained in:
@@ -100,7 +100,17 @@ liberator.Bookmarks = function () //{{{
|
||||
|
||||
liberator.options.add(["defsearch", "ds"],
|
||||
"Set the default search engine",
|
||||
"string", "google");
|
||||
"string", "google",
|
||||
{
|
||||
completer: function (filter)
|
||||
{
|
||||
return liberator.completion.url("", "s")[1];
|
||||
},
|
||||
validator: function (value)
|
||||
{
|
||||
return liberator.completion.url("", "s")[1].some(function (s) s[0] == value);
|
||||
}
|
||||
});
|
||||
|
||||
liberator.options.add(["preload"],
|
||||
"Speed up first time history/bookmark completion",
|
||||
|
||||
@@ -700,7 +700,7 @@ liberator.Options = function () //{{{
|
||||
if (option.hasName(filter))
|
||||
{
|
||||
if (option.completer)
|
||||
return [filter.length + 1, option.completer(filter)];
|
||||
return [filter.length + 1, option.completer(filter)]; // FIXME: filter should be component after "option="
|
||||
return [filter.length + 1, [[option.value + "", ""]]];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user