1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-07 12:05:47 +01:00

add commandline completion to 'defsearch'

This commit is contained in:
Doug Kearns
2008-09-10 18:26:51 +00:00
parent 55b5a3b6f3
commit 13e504c0a4
3 changed files with 13 additions and 2 deletions

1
NEWS
View File

@@ -3,6 +3,7 @@
* version 2.0 (probably)
* IMPORTANT: renamed Startup and Quit autocmd events to VimperatorEnter and
VimperatorLeave respectively
* add commandline completion to 'defsearch'
* add 'helpfile' option
* add 'wildignore' option
* add :finish command

View File

@@ -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",

View File

@@ -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 + "", ""]]];
}
}