Bug 1463860 - Don't play a beep when the find string is not find when Whole Word matching is enabled; it simply beeps too much. r?ehsan
MozReview-Commit-ID: S6dvbV5Q5d
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -1125,18 +1125,18 @@ nsTypeAheadFind::Find(const nsAString& a
RefPtr<nsRange> startFindRange = selection->GetRangeAt(0);
if (startFindRange) {
mStartFindRange = startFindRange->CloneRange();
}
}
}
}
else {
- // Error sound
- if (mTypeAheadBuffer.Length() > mLastFindLength)
+ // Error sound, except when whole word matching is ON.
+ if (!mEntireWord && mTypeAheadBuffer.Length() > mLastFindLength)
PlayNotFoundSound();
}
SaveFind();
return NS_OK;
}
void