From a0adb276d0d4f41bdfa25b080294b8038c3df2e4 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 20 Dec 2010 03:46:13 -0500 Subject: [PATCH] Fix minor completion bug with quoting. --- common/content/completion.js | 6 ++++-- common/content/finder.js | 11 +---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/common/content/completion.js b/common/content/completion.js index c536c781..7c7f9b5e 100644 --- a/common/content/completion.js +++ b/common/content/completion.js @@ -566,14 +566,16 @@ const CompletionContext = Class("CompletionContext", { */ advance: function advance(count) { delete this._ignoreCase; + let advance = count; if (this.quote && count) { - count = this.quote[0].length + this.quote[1](this.filter.substr(0, count)).length; + advance = this.quote[1](this.filter.substr(0, count)).length; + count = this.quote[0].length + advance; this.quote[0] = ""; this.quote[2] = ""; } this.offset += count; if (this._filter) - this._filter = this._filter.substr(count); + this._filter = this._filter.substr(advance); }, /** diff --git a/common/content/finder.js b/common/content/finder.js index 93ca6a6d..9a8a37c9 100644 --- a/common/content/finder.js +++ b/common/content/finder.js @@ -610,16 +610,7 @@ const RangeFind = Class("RangeFind", { this.save(); }, - intersects: function (range) { - try { - return this.range.compareBoundaryPoints(range.START_TO_END, range) >= 0 && - this.range.compareBoundaryPoints(range.END_TO_START, range) <= 0; - } - catch (e) { - dactyl.reportError(e, true); - return false; - } - }, + intersects: function (range) RangeFind.intersects(this.range, range), save: function () { this.scroll = Point(this.window.pageXOffset, this.window.pageYOffset);