diff --git a/common/content/liberator.js b/common/content/liberator.js index c3e65fc8..c947b019 100644 --- a/common/content/liberator.js +++ b/common/content/liberator.js @@ -110,14 +110,19 @@ const liberator = (function () //{{{ } }, scroll: { - opts: { r: ["Right Scrollbar"] }, + opts: { r: ["Right Scrollbar", "vertical"], l: ["Left Scrollbar", "vertical"], b: ["Bottom Scrollbar", "horizontal"] }, setter: function (opts) { - if (opts.indexOf("r") == -1) - styles.addSheet("scrollbar", "*", "html|html > xul|scrollbar { visibility: collapse !important; }", true, true); + let dir = ["horizontal", "vertical"].filter(function (dir) !Array.some(opts, function (o) this.opts[o][1] == dir, this), this); + let class = dir.map(function (dir) "html|html > xul|scrollbar[orient=" + dir + "]"); + + if (class.length) + styles.addSheet("scrollbar", "*", class.join(", ") + " { visibility: collapse !important; }", true, true); else styles.removeSheet("scrollbar", null, null, null, true); - } + options.setPref("layout.scrollbar.side", opts.indexOf("l") >= 0 ? 3 : 2); + }, + validator: function (opts) (opts.indexOf("l") < 0 || opts.indexOf("r") < 0) }, tab: { opts: { @@ -150,7 +155,8 @@ const liberator = (function () //{{{ opts = opts.map(function (opt) [[k, v[0]] for ([k, v] in Iterator(opt))]); return util.Array.flatten(opts); }, - validator: Option.validateCompleter + validator: function (val) Option.validateCompleter.call(this, val) && + [v for ([k, v] in Iterator(groups))].every(function (g) !g.validator || g.validator(val)) }); options.add(["helpfile", "hf"], diff --git a/vimperator/NEWS b/vimperator/NEWS index 22cdf524..306b84a0 100644 --- a/vimperator/NEWS +++ b/vimperator/NEWS @@ -1,5 +1,7 @@ 2008-XX-XX: * version 2.0 (probably) + * IMPORTANT: For compatibility with vim, guioptions=b has been renamed + 'B'. 'b' now represents the bottom scrollbar. * IMPORTANT: :set now sets multiple options, as in Vim. Spaces in values must be quoted or escaped. * IMPORTANT: Due to much improved autocompletion, changed default 'complete' option diff --git a/vimperator/content/config.js b/vimperator/content/config.js index f13a8b80..e6c1ddc5 100644 --- a/vimperator/content/config.js +++ b/vimperator/content/config.js @@ -33,12 +33,12 @@ const config = { //{{{ /*** optional options, there are checked for existance and a fallback provided ***/ features: ["bookmarks", "hints", "history", "marks", "quickmarks", "session", "tabs", "windows"], - defaults: { guioptions: "r" }, + defaults: { guioptions: "rb" }, guioptions: { m: ["Menubar", ["toolbar-menubar"]], T: ["Toolbar", ["nav-bar"]], - b: ["Bookmark bar", ["PersonalToolbar"]] + B: ["Bookmark bar", ["PersonalToolbar"]] }, get visualbellWindow() getBrowser().mPanelContainer,