diff --git a/NEWS b/NEWS index f5e7952c..7110a949 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,8 @@ 2007-xx-xx: * version 0.6 * THIS VERSION ONLY WORKS WITH FIREFOX 3.0 - * added new :mkvimperatorc command + * options are no longer stored in preferences - use the RC file instead + * added new :mkvimperatorc command * you can edit textfields with Ctrl-i now using an external editor (thanks to Joseph Xu) * :open, :bmarks, etc. filter on space separated tokens now, so you can search with :open linux windows <tab> all your bookmarks/history @@ -43,7 +44,7 @@ * added 'visualbellstyle' for styling/hiding the visual bell * merge the existing status bar with the standard FF status bar so that security information and extension buttons are included - * :buffer partial_string works now as in vim, and with ! even better + * :buffer partial_string works now as in vim, and with ! even better * new :time command for profiling * added new :sidebar and :sbclose commands * added 'more' and standard more-prompt key mappings to control diff --git a/content/options.js b/content/options.js index 67645d0c..152baaec 100644 --- a/content/options.js +++ b/content/options.js @@ -31,14 +31,13 @@ function Option(names, type, extra_info) //{{{ if (!names || !type) return null; + var value = null; + this.name = names[0]; this.names = names; this.usage = this.names; this.type = type; - this.setter = function(value) { Options.setPref(this.name, value); }; - this.getter = function() { return Options.getPref(this.name); }; - if (extra_info) { if (extra_info.usage) @@ -53,6 +52,8 @@ function Option(names, type, extra_info) //{{{ else this.default_value = null; + value = this.default_value; + if (extra_info.setter) this.setter = extra_info.setter; if (extra_info.getter) @@ -75,8 +76,22 @@ function Option(names, type, extra_info) //{{{ } // NOTE: forced defaults need to use Options.getPref - Option.prototype.__defineGetter__("value", function() { return this.getter.call(this); }); - Option.prototype.__defineSetter__("value", function(value) { this.setter.call(this, value); }); + this.__defineGetter__("value", + function() + { + if (this.getter) + this.getter.call(this); + return value; + } + ); + this.__defineSetter__("value", + function(new_value) + { + value = new_value; + if (this.setter) + this.setter.call(this, value); + } + ); // TODO: add is[Type]() queries for use in set()? // : add isValid() or just throw an exception? @@ -461,7 +476,7 @@ function Options() //{{{ "
:set titlestring=Mozilla Firefox.",
- setter: function(value) { Options.setPref("titlestring", value); setTitleString(value); },
+ setter: function(value) { setTitleString(value); },
default_value: "Vimperator"
}
));
@@ -673,7 +688,7 @@ function Options() //{{{
addOption(new Option(["visualbell", "vb"], "boolean",
{
short_help: "Use visual bell instead of beeping on errors",
- setter: function(value) { Options.setPref("visualbell", value); Options.setFirefoxPref("accessibility.typeaheadfind.enablesound", !value); },
+ setter: function(value) { Options.setFirefoxPref("accessibility.typeaheadfind.enablesound", !value); },
default_value: false
}
));