diff --git a/common/content/bookmarks.js b/common/content/bookmarks.js index 1195af43..0cb4d0ab 100644 --- a/common/content/bookmarks.js +++ b/common/content/bookmarks.js @@ -58,7 +58,8 @@ const Bookmarks = Module("bookmarks", { if (!id) return false; - PlacesUtils.setPostDataForBookmark(id, post); + if (post !== undefined) + PlacesUtils.setPostDataForBookmark(id, post); if (keyword) services.get("bookmarks").setKeywordForBookmark(id, keyword); } @@ -359,7 +360,7 @@ const Bookmarks = Module("bookmarks", { force: args.bang, starOnly: false, keyword: args["-keyword"] || null, - post: args["-post"] || null, + post: args["-post"], tags: args["-tags"] || [], title: args["-title"] || (args.length === 0 ? buffer.title : null), url: args.length === 0 ? buffer.URL : args[0] diff --git a/common/content/hints.js b/common/content/hints.js index 5815372e..4e672459 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -38,6 +38,9 @@ const Hints = Module("hints", { self._showHints(); } }); + let appContent = document.getElementById("appcontent"); + if (appContent) + events.addSessionListener(appContent, "scroll", this._resizeTimer.closure.tell, false); const Mode = Hints.Mode; Mode.defaultValue("tags", function () function () options["hinttags"]); @@ -91,8 +94,15 @@ const Hints = Module("hints", { this._activeTimeout = null; }, __reset: function () { - if (!this._usedTabKey) + if (!this._usedTabKey) { this._hintNumber = 0; + } + if (this.__continue && this._validHints.length <= 1) { + this._hintString = ""; + commandline.command = this._hintString; + this._showHints(); + } + this._updateStatusline(); }, /** @@ -334,11 +344,11 @@ const Hints = Module("hints", { * @param {boolean} active Whether it is the currently active hint or not. */ _setClass: function (elem, active) { - let prefix = (elem.getAttributeNS(NS.uri, "class") || "") + " "; + let prefix = (elem.getAttributeNS(NS, "class") || "") + " "; if (active) - elem.setAttributeNS(NS.uri, "highlight", prefix + "HintActive"); + elem.setAttributeNS(NS, "highlight", prefix + "HintActive"); else - elem.setAttributeNS(NS.uri, "highlight", prefix + "HintElem"); + elem.setAttributeNS(NS, "highlight", prefix + "HintElem"); }, /** @@ -363,7 +373,7 @@ const Hints = Module("hints", { hint.imgSpan.style.display = (valid ? "" : "none"); if (!valid) { - hint.elem.removeAttributeNS(NS.uri, "highlight"); + hint.elem.removeAttributeNS(NS, "highlight"); continue inner; } @@ -399,7 +409,7 @@ const Hints = Module("hints", { // FIXME: Broken for imgspans. for (let [, { doc: doc }] in Iterator(this._docs)) { for (let elem in util.evaluateXPath("//*[@dactyl:highlight and @number]", doc)) { - let group = elem.getAttributeNS(NS.uri, "highlight"); + let group = elem.getAttributeNS(NS, "highlight"); css.push(highlight.selector(group) + "[number=" + elem.getAttribute("number").quote() + "] { " + elem.style.cssText + " }"); } } @@ -418,20 +428,12 @@ const Hints = Module("hints", { * hint disappears. */ _removeHints: function (timeout, slight) { - let firstElem = this._validHints[0] || null; - for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) { + util.dump(String(doc), start, end); for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc)) elem.parentNode.removeChild(elem); - for (let i in util.range(start, end + 1)) { - let hint = this._pageHints[i]; - if (!timeout || hint.elem != firstElem) - hint.elem.removeAttributeNS(NS.uri, "highlight"); - } - - // animate the disappearance of the first hint - if (timeout && firstElem) - this.timeout(function () { firstElem.removeAttributeNS(NS.uri, "highlight"); }, timeout); + for (let i in util.range(start, end + 1)) + this._pageHints[i].elem.removeAttributeNS(NS, "highlight"); } styles.removeSheet(true, "hint-positions"); @@ -479,17 +481,21 @@ const Hints = Module("hints", { let activeIndex = (this._hintNumber ? this._hintNumber - 1 : 0); let elem = this._validHints[activeIndex]; let top = this._top; - if (this._continue) { + + if (this._continue) this.__reset(); - if (this._validHints.length <= 1) - this._showHints(); - } - else { + else this._removeHints(timeout); - if (timeout == 0) - // force a possible mode change, based on whether an input field has focus - events.onFocusChange(); - } + + let n = 5; + (function next() { + this._setClass(elem, n % 2); + util.dump(n, String(this._top)); + if (n--) + this.timeout(next, 50); + else if (!this._validHints.some(function (h) h.elem == elem)) + elem.removeAttributeNS(NS, "highlight"); + }).call(this); this.timeout(function () { if ((modes.extended & modes.HINTS) && !this._continue) @@ -512,7 +518,9 @@ const Hints = Module("hints", { if (this._hintNumber > 0 && this._hintNumber * this.hintKeys.length <= this._validHints.length) { let timeout = options["hinttimeout"]; if (timeout > 0) - this._activeTimeout = this.timeout(function () { this._processHints(true); }, timeout); + this._activeTimeout = this.timeout(function () { + this._processHints(true); + }, timeout); } else // we have a unique hint this._processHints(true); @@ -906,6 +914,7 @@ const Hints = Module("hints", { dactyl.assert(this._hintNumber != 0); this._checkUnique(); + return; } } diff --git a/common/content/javascript.js b/common/content/javascript.js index c0d30380..a29ffadf 100644 --- a/common/content/javascript.js +++ b/common/content/javascript.js @@ -537,7 +537,7 @@ const JavaScript = Module("javascript", { args.push(key + string); let compl = function (context, obj) { - let res = completer.call(self, context, funcName, obj, args); + let res = completer.call(self, context, funcName, obj.obj, args); if (res) context.completions = res; }; diff --git a/common/locale/en-US/all.xml b/common/locale/en-US/all.xml index ccb98583..52586868 100644 --- a/common/locale/en-US/all.xml +++ b/common/locale/en-US/all.xml @@ -12,29 +12,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/locale/en-US/cmdline.xml b/common/locale/en-US/cmdline.xml index 1f911d34..825f56b1 100644 --- a/common/locale/en-US/cmdline.xml +++ b/common/locale/en-US/cmdline.xml @@ -152,6 +152,7 @@ +

Ex command lines

@@ -212,7 +213,73 @@

-
+ + +

Ex command-line arguments

+ +

+ Most Ex commands accept a number of options and arguments. Arguments and + options are generally separated by spaces, and treat a number of + characters, including \, ', ", and |, + specially. Moreover, certain arguments have their own special characters. + For instance, when using :set to change a stringlist + option, the comma character is used to separate elements of said list. Or + when calling :autocmd, the pattern given may be negated by + prefixing it with a !. In order to use these characters in + command arguments, stripped of their special meaning, they must be quoted. +

+ +

+ &dactyl.appName; offers four distinct quoting styles, each with its own + distinct advantages and disadvantages. The first, and most basic, is the + automatic quoting applied to the commands listed in :bar. When + any of these commands is invoked, their final argument is always + interpreted literally. No characters have special meaning whatsoever, and + no care need be taken to quote anything. Additionally, the following three + optional quoting characters are available: +

+ +
+
\
+
+ This is the most basic quoting character. When it is encountered + outside of single or double quotes, it forces the next character to be + interpreted literally. So, for instance, \\\, + \'', \aa, and + \␣. +
+
'
+
+ Any character inside single quotes aside from the ' character itself + is interpreted literally. To include a literal single quote, it must + be doubled. So, 'foo\ ''bar\\ baz\' ⇒ foo\ 'bar\\ baz\ +
+
"
+
+ Any character inside of double quotes except for " and + \ is interpreted literally. A literal double quote may be + included by preceding it with a backslash. Any other occurrence of a + backslash starts an escape sequence as in JavaScript strings. Among + the available escape sequences are: +
+
\n
A newline character.
+
\t
A tab character.
+
\0nn
Where each n is a digit between 0 and 7, represents an octal character code.
+
\xdd
Where each d is a digit between 0 and F, represents a hexidecimal character code.
+
\uxxxx
Where each x is a digit between 0 and F, a Unicode character at code-point xxxx.
+
+
+
+ +

+ Many Ex commands accept option arguments in addition to regular arguments. + Option arguments begin with a hyphen (-), and often have a short + form and a long form, such as -name and -n. Most options + accept arguments, which come after the option separated by either a space + or an equal sign. For instance, the following three forms, + -name=foo, -name foo, and + -n foo, are all acceptable and entirely equivalent. +

diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 09cd9391..4077d9c4 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -816,7 +816,7 @@ Class.prototype = { */ timeout: function (callback, timeout) { const self = this; - let notify = { notify: function notify(timer) { callback.call(self) } }; + let notify = { notify: function notify(timer) { try { callback.apply(self) } catch (e) { util.reportError(e) } } }; let timer = services.create("timer"); timer.initWithCallback(notify, timeout || 0, timer.TYPE_ONE_SHOT); return timer; diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index 0c57a174..f262e5ea 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -292,8 +292,12 @@ const Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakR "Set the 'private browsing' option", "boolean", false, { - setter: function (value) services.get("privateBrowsing").privateBrowsingEnabled = value, - getter: function () services.get("privateBrowsing").privateBrowsingEnabled + initialValue: true, + getter: function () services.get("privateBrowsing").privateBrowsingEnabled, + setter: function (value) { + if (services.get("privateBrowsing").privateBrowsingEnabled != value) + services.get("privateBrowsing").privateBrowsingEnabled = value + } }); options.add(["sanitizeitems", "si"], diff --git a/pentadactyl/TODO b/pentadactyl/TODO index bbf5e43d..8b83f75f 100644 --- a/pentadactyl/TODO +++ b/pentadactyl/TODO @@ -25,7 +25,6 @@ BUGS: (recent Mercurial regressions): FEATURES: -9 Add quoting help tag 8 Document Caret and Visual modes. 8 replace global variables with plugin scoped user options 8 fix local options diff --git a/pentadactyl/locale/en-US/all.xml b/pentadactyl/locale/en-US/all.xml index 32e54296..b0335c24 100644 --- a/pentadactyl/locale/en-US/all.xml +++ b/pentadactyl/locale/en-US/all.xml @@ -7,7 +7,7 @@ xmlns="&xmlns.dactyl;" xmlns:html="&xmlns.html;"> - +