mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 07:27:58 +01:00
Rename some functions. Add options.(set|get|reset|invert)Pref completion
This commit is contained in:
@@ -690,10 +690,6 @@ function Options() //{{{
|
||||
{
|
||||
var optionCompletions = [];
|
||||
|
||||
// What is this all about then, eh? It's too late to guess... -- djk
|
||||
//if (prefix)
|
||||
// filter = filter.replace(ret.prefix, "");
|
||||
|
||||
if (special) // list completions for about:config entries
|
||||
{
|
||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"]
|
||||
@@ -851,6 +847,14 @@ function Options() //{{{
|
||||
liberator.registerObserver("load_completion", function ()
|
||||
{
|
||||
completion.setFunctionCompleter(options.get, [function () ([o.name, o.description] for (o in options))]);
|
||||
let listPrefs = [function () Components.classes["@mozilla.org/preferences-service;1"]
|
||||
.getService(Components.interfaces.nsIPrefBranch)
|
||||
.getChildList("", { value: 0 })
|
||||
.map(function (pref) [pref, ""])];
|
||||
completion.setFunctionCompleter(options.getPref, listPrefs);
|
||||
completion.setFunctionCompleter(options.setPref, listPrefs);
|
||||
completion.setFunctionCompleter(options.resetPref, listPrefs);
|
||||
completion.setFunctionCompleter(options.invertPref, listPrefs);
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user