From 535293a53eb672dc31108f4d45e2c0e395ab68a5 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 10 Jun 2010 01:30:03 -0400 Subject: [PATCH] Fix finding from caret. --HG-- branch : testing --- common/content/finder.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/content/finder.js b/common/content/finder.js index aa78d3a7..2cd391b4 100644 --- a/common/content/finder.js +++ b/common/content/finder.js @@ -270,8 +270,7 @@ const RangeFind = Class("RangeFind", { get selectedRange() { let range = RangeFind.Range(tabs.localStore.focusedFrame || content); - range = (range.selection.rangeCount ? range.selection.getRangeAt(0) : this.ranges[0].range).cloneRange(); - return range; + return (range.selection.rangeCount ? range.selection.getRangeAt(0) : this.ranges[0].range).cloneRange(); }, reset: function () { @@ -411,6 +410,9 @@ const RangeFind = Class("RangeFind", { }, search: function (word, reverse, private_) { + if (!private_ && this.lastRange && !RangeFind.equal(this.selectedRange, this.lastRange)) + this.reset(); + this.wrapped = false; this.finder.findBackwards = reverse ? !this.reverse : this.reverse; let again = word == null; @@ -426,8 +428,6 @@ const RangeFind = Class("RangeFind", { this.range.descroll(); this.lastRange = this.startRange; this.range = this.ranges.first; - } else if (!private_ && this.lastRange && !RangeFind.equal(this.selectedRange, this.lastRange)) { - this.reset(); } if (word == "")