mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 12:57:58 +01:00
Define option getters to return Optionhints.jsvalues rather than #value.
This commit is contained in:
@@ -532,8 +532,7 @@ const Buffer = Module("buffer", {
|
|||||||
* RegExp.
|
* RegExp.
|
||||||
*/
|
*/
|
||||||
followDocumentRelationship: function (rel) {
|
followDocumentRelationship: function (rel) {
|
||||||
let regexes = options.get(rel + "pattern").values
|
let regexes = options[rel + "pattern"].map(function (re) RegExp(re, "i"));
|
||||||
.map(function (re) RegExp(re, "i"));
|
|
||||||
|
|
||||||
function followFrame(frame) {
|
function followFrame(frame) {
|
||||||
function iter(elems) {
|
function iter(elems) {
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ const CommandLine = Module("commandline", {
|
|||||||
|
|
||||||
this._autocompleteTimer = Timer(200, 500, function autocompleteTell(tabPressed) {
|
this._autocompleteTimer = Timer(200, 500, function autocompleteTell(tabPressed) {
|
||||||
dactyl.trapErrors(function () {
|
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);
|
self._completions.complete(true, false);
|
||||||
if (self._completions)
|
if (self._completions)
|
||||||
self._completions.itemList.show();
|
self._completions.itemList.show();
|
||||||
@@ -95,7 +95,7 @@ const CommandLine = Module("commandline", {
|
|||||||
this._tabTimer = Timer(0, 0, function tabTell(event) {
|
this._tabTimer = Timer(0, 0, function tabTell(event) {
|
||||||
dactyl.trapErrors(function () {
|
dactyl.trapErrors(function () {
|
||||||
if (self._completions)
|
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)
|
if (this.context.waitingForTab || this.wildIndex == -1)
|
||||||
this.complete(true, true);
|
this.complete(true, true);
|
||||||
|
|
||||||
this.tabs.push([reverse, wildmode || options.get("wildmode").values]);
|
this.tabs.push([reverse, wildmode || options["wildmode"]]);
|
||||||
if (this.waiting)
|
if (this.waiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -698,7 +698,7 @@ const Hints = Module("hints", {
|
|||||||
if (options.get("hintmatching").has("transliterated"))
|
if (options.get("hintmatching").has("transliterated"))
|
||||||
indexOf = Hints.indexOf;
|
indexOf = Hints.indexOf;
|
||||||
|
|
||||||
switch (options.get("hintmatching").values[0]) {
|
switch (options["hintmatching"][0]) {
|
||||||
case "contains" : return containsMatcher(hintString);
|
case "contains" : return containsMatcher(hintString);
|
||||||
case "wordstartswith": return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ true);
|
case "wordstartswith": return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ true);
|
||||||
case "firstletters" : return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ false);
|
case "firstletters" : return wordStartsWithMatcher(hintString, /*allowWordOverleaping=*/ false);
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ const IO = Module("io", {
|
|||||||
* @returns {nsIFile[])
|
* @returns {nsIFile[])
|
||||||
*/
|
*/
|
||||||
getRuntimeDirectories: function (name) {
|
getRuntimeDirectories: function (name) {
|
||||||
let dirs = options.get("runtimepath").values;
|
let dirs = options["runtimepath"];
|
||||||
|
|
||||||
dirs = dirs.map(function (dir) File.joinPaths(dir, name, this.cwd))
|
dirs = dirs.map(function (dir) File.joinPaths(dir, name, this.cwd))
|
||||||
.filter(function (dir) dir.exists() && dir.isDirectory() && dir.isReadable());
|
.filter(function (dir) dir.exists() && dir.isDirectory() && dir.isReadable());
|
||||||
@@ -276,10 +276,10 @@ lookup:
|
|||||||
* @param {boolean} all Whether all found files should be sourced.
|
* @param {boolean} all Whether all found files should be sourced.
|
||||||
*/
|
*/
|
||||||
sourceFromRuntimePath: function (paths, all) {
|
sourceFromRuntimePath: function (paths, all) {
|
||||||
let dirs = options.get("runtimepath").values;
|
let dirs = options["runtimepath"];
|
||||||
let found = false;
|
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:
|
outer:
|
||||||
for (let [, dir] in Iterator(dirs)) {
|
for (let [, dir] in Iterator(dirs)) {
|
||||||
@@ -541,7 +541,7 @@ lookup:
|
|||||||
dactyl.echomsg(io.cwd);
|
dactyl.echomsg(io.cwd);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let dirs = options.get("cdpath").values;
|
let dirs = options["cdpath"];
|
||||||
for (let [, dir] in Iterator(dirs)) {
|
for (let [, dir] in Iterator(dirs)) {
|
||||||
dir = File.joinPaths(dir, arg, io.cwd);
|
dir = File.joinPaths(dir, arg, io.cwd);
|
||||||
|
|
||||||
|
|||||||
@@ -641,8 +641,8 @@ const Options = Module("options", {
|
|||||||
memoize(this.needInit, this.needInit.length, closure);
|
memoize(this.needInit, this.needInit.length, closure);
|
||||||
|
|
||||||
// quickly access options with options["wildmode"]:
|
// quickly access options with options["wildmode"]:
|
||||||
this.__defineGetter__(name, function () this._optionMap[name].value);
|
this.__defineGetter__(name, function () this._optionMap[name].values);
|
||||||
this.__defineSetter__(name, function (value) { this._optionMap[name].value = value; });
|
this.__defineSetter__(name, function (value) { this._optionMap[name].values = value; });
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user