diff --git a/common/content/hints.js b/common/content/hints.js index 812ff1f7..8a17950a 100644 --- a/common/content/hints.js +++ b/common/content/hints.js @@ -96,8 +96,13 @@ const Hints = Module("hints", { __reset: function () { if (!this._usedTabKey) { this._hintNumber = 0; - this._updateStatusline(); } + if (this.__continue && this._validHints.length <= 1) { + this._hintString = ""; + commandline.command = this._hintString; + this._showHints(); + } + this._updateStatusline(); }, /** @@ -424,6 +429,7 @@ const Hints = Module("hints", { */ _removeHints: function (timeout, slight) { 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)) @@ -476,21 +482,18 @@ const Hints = Module("hints", { 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); - } 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._top) + else if (!this._validHints.some(function (h) h.elem == elem)) elem.removeAttributeNS(NS, "highlight"); }).call(this); diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 9710382b..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.apply(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;