mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 18:55:46 +01:00
Context-specific completer options. Option refactoring.
New review Owner: dougkearns Hopefully the changeset hash will actually be linked this time. If not, it's the tip of the testing branch, presumably r4161. I've been meaning to do this for a while. It allows case matching, sorting, and auto completion options to be assigned on a per context basis, with fine grained control. It also adds builtin regex support to options since it's used fairly extensively. There are definitely other options that would benefit from the regexlist type, if I can dig them up. The interface (and perhaps the doc wording) is the only place I'm really ambivalent. --HG-- branch : testing
This commit is contained in:
@@ -598,6 +598,18 @@ const Bookmarks = Module("bookmarks", {
|
||||
context.completions = [["", "Don't perform searches by default"]].concat(context.completions);
|
||||
}
|
||||
});
|
||||
|
||||
options.add(["suggestengines"],
|
||||
"Engine Alias which has a feature of suggest",
|
||||
"stringlist", "google",
|
||||
{
|
||||
completer: function completer(value) {
|
||||
let engines = services.get("browserSearch").getEngines({})
|
||||
.filter(function (engine) engine.supportsResponseType("application/x-suggestions+json"));
|
||||
|
||||
return engines.map(function (engine) [engine.alias, engine.description]);
|
||||
}
|
||||
});
|
||||
},
|
||||
completion: function () {
|
||||
completion.bookmark = function bookmark(context, tags, extra) {
|
||||
|
||||
Reference in New Issue
Block a user