summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/content/buffer.js3
-rw-r--r--common/modules/options.jsm38
2 files changed, 22 insertions, 19 deletions
diff --git a/common/content/buffer.js b/common/content/buffer.js
index 22b16d0a..ea722146 100644
--- a/common/content/buffer.js
+++ b/common/content/buffer.js
@@ -2288,7 +2288,8 @@ var Buffer = Module("buffer", {
setter: function setter(value) {
prefs.set(this.PREF, value > 1);
- return value > 1 ? value : this.globalValue;
+ if (value > 1)
+ return value;
},
validator: function (value) value > 0
diff --git a/common/modules/options.jsm b/common/modules/options.jsm
index ec08d861..8547a13c 100644
--- a/common/modules/options.jsm
+++ b/common/modules/options.jsm
@@ -600,6 +600,23 @@ var Option = Class("Option", {
return null;
},
+ string: function string(operator, values, scope, invert) {
+ if (invert)
+ return values[(values.indexOf(this.value) + 1) % values.length];
+
+ switch (operator) {
+ case "+":
+ return this.value + values;
+ case "-":
+ return this.value.replace(values, "");
+ case "^":
+ return values + this.value;
+ case "=":
+ return values;
+ }
+ return null;
+ },
+
stringmap: function stringmap(operator, values, scope, invert) {
let res = update({}, this.value);
@@ -657,23 +674,7 @@ var Option = Class("Option", {
get regexplist() this.stringlist,
get regexpmap() this.stringlist,
get sitelist() this.stringlist,
- get sitemap() this.stringlist,
-
- string: function string(operator, values, scope, invert) {
- if (invert)
- return values[(values.indexOf(this.value) + 1) % values.length];
- switch (operator) {
- case "+":
- return this.value + values;
- case "-":
- return this.value.replace(values, "");
- case "^":
- return values + this.value;
- case "=":
- return values;
- }
- return null;
- }
+ get sitemap() this.stringlist
},
validIf: function validIf(test, error) {
@@ -1005,7 +1006,8 @@ var Options = Module("options", {
res.optionValue = res.option.get(res.scope);
try {
- res.values = res.option.parse(res.value);
+ if (!res.invert || res.option.type != "number") // Hack.
+ res.values = res.option.parse(res.value);
}
catch (e) {
res.error = e;