1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 21:37:58 +01:00

:set! now lets you change about:config prefs

This commit is contained in:
Daniel Bainton
2008-01-11 14:42:18 +00:00
parent 100a41c51a
commit bdfe11a031
5 changed files with 170 additions and 41 deletions

View File

@@ -370,7 +370,34 @@ vimperator.Completion = function () //{{{
}
if (special)
alert(":set! completion will complete about:config options");
{
var firefoxBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
var prefArray = firefoxBranch.getChildList("", {value: 0});
prefArray.sort();
if (filter.length > 0 && filter.lastIndexOf("=") == filter.length - 1)
{
for (var i = 0; i < prefArray.length; i++)
{
var name = prefArray[i];
if (name.match("^" + filter.substr(0, filter.length - 1) + "$" ))
{
var value = vimperator.options.getFirefoxPref(name);
return [filter.length + 1, [[value, ""]]];
}
}
return [0, []];
}
for (var i = 0; i < prefArray.length; i++)
optionCompletions.push([prefArray[i], vimperator.options.getFirefoxPref(prefArray[i])]);
if (!filter)
return [0, optionCompletions];
return [0, buildLongestCommonSubstring(optionCompletions, filter)];
}
if (!filter)
{