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

Define option getters to return Optionhints.jsvalues rather than #value.

This commit is contained in:
Kris Maglione
2010-09-24 16:11:17 -04:00
parent 3645cd27d0
commit 5bf3784ab2
5 changed files with 11 additions and 12 deletions

View File

@@ -532,8 +532,7 @@ const Buffer = Module("buffer", {
* RegExp.
*/
followDocumentRelationship: function (rel) {
let regexes = options.get(rel + "pattern").values
.map(function (re) RegExp(re, "i"));
let regexes = options[rel + "pattern"].map(function (re) RegExp(re, "i"));
function followFrame(frame) {
function iter(elems) {

View File

@@ -80,7 +80,7 @@ const CommandLine = Module("commandline", {
this._autocompleteTimer = Timer(200, 500, function autocompleteTell(tabPressed) {
dactyl.trapErrors(function () {
if (!events.feedingKeys && self._completions && options.get("autocomplete").values.length) {
if (!events.feedingKeys && self._completions && options["autocomplete"].length) {
self._completions.complete(true, false);
if (self._completions)
self._completions.itemList.show();
@@ -95,7 +95,7 @@ const CommandLine = Module("commandline", {
this._tabTimer = Timer(0, 0, function tabTell(event) {
dactyl.trapErrors(function () {
if (self._completions)
self._completions.tab(event.shiftKey, event.altKey && options.get("altwildmode").values);
self._completions.tab(event.shiftKey, event.altKey && options["altwildmode"]);
});
});
@@ -1347,7 +1347,7 @@ const CommandLine = Module("commandline", {
if (this.context.waitingForTab || this.wildIndex == -1)
this.complete(true, true);
this.tabs.push([reverse, wildmode || options.get("wildmode").values]);
this.tabs.push([reverse, wildmode || options["wildmode"]]);
if (this.waiting)
return;

View File

@@ -698,7 +698,7 @@ const Hints = Module("hints", {
if (options.get("hintmatching").has("transliterated"))
indexOf = Hints.indexOf;
switch (options.get("hintmatching").values[0]) {
switch (options["hintmatching"][0]) {
case "contains" : return containsMatcher(hintString);
case "wordstartswith": return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ true);
case "firstletters" : return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ false);

View File

@@ -158,7 +158,7 @@ const IO = Module("io", {
* @returns {nsIFile[])
*/
getRuntimeDirectories: function (name) {
let dirs = options.get("runtimepath").values;
let dirs = options["runtimepath"];
dirs = dirs.map(function (dir) File.joinPaths(dir, name, this.cwd))
.filter(function (dir) dir.exists() && dir.isDirectory() && dir.isReadable());
@@ -276,10 +276,10 @@ lookup:
* @param {boolean} all Whether all found files should be sourced.
*/
sourceFromRuntimePath: function (paths, all) {
let dirs = options.get("runtimepath").values;
let dirs = options["runtimepath"];
let found = false;
dactyl.echomsg("Searching for " + paths.join(" ").quote() + " in " + options["runtimepath"].quote(), 2);
dactyl.echomsg("Searching for " + paths.join(" ").quote() + " in " + options.get("runtimepath").value, 2);
outer:
for (let [, dir] in Iterator(dirs)) {
@@ -541,7 +541,7 @@ lookup:
dactyl.echomsg(io.cwd);
}
else {
let dirs = options.get("cdpath").values;
let dirs = options["cdpath"];
for (let [, dir] in Iterator(dirs)) {
dir = File.joinPaths(dir, arg, io.cwd);

View File

@@ -641,8 +641,8 @@ const Options = Module("options", {
memoize(this.needInit, this.needInit.length, closure);
// quickly access options with options["wildmode"]:
this.__defineGetter__(name, function () this._optionMap[name].value);
this.__defineSetter__(name, function (value) { this._optionMap[name].value = value; });
this.__defineGetter__(name, function () this._optionMap[name].values);
this.__defineSetter__(name, function (value) { this._optionMap[name].values = value; });
},
/**