summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarina Zhurakhinskaya <marinaz@redhat.com>2009-10-05 17:50:58 (GMT)
committerMarina Zhurakhinskaya <marinaz@redhat.com>2009-10-05 17:50:58 (GMT)
commitaed1e67addc8e9661cb34856d42713d2f1d44a58 (patch)
treee0d5fb4c645be4d7d20f26f8a566cc19ac3d42f1
parentdc99e8ffcd8392fe89338f3c8c8a750b956fe852 (diff)
downloadgnome-shell-aed1e67addc8e9661cb34856d42713d2f1d44a58.tar.gz
gnome-shell-aed1e67addc8e9661cb34856d42713d2f1d44a58.tar.xz
Check that no new term was introduced before doing a subsearch
We combine search terms with OR, so if a new search term is introduced, the search results are no longer a subset of the previous search results.
-rw-r--r--js/ui/genericDisplay.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/js/ui/genericDisplay.js b/js/ui/genericDisplay.js
index e15df20..cbd211f 100644
--- a/js/ui/genericDisplay.js
+++ b/js/ui/genericDisplay.js
@@ -370,7 +370,11 @@ GenericDisplay.prototype = {
return;
let flags = RedisplayFlags.RESET_CONTROLS;
if (this._search != '') {
- if (lowertext.indexOf(this._search) == 0)
+ // Because we combine search terms with OR, we have to be sure that no new term
+ // was introduced before deciding that the new search results will be a subset of
+ // the existing search results.
+ if (lowertext.indexOf(this._search) == 0 &&
+ lowertext.split(/\s+/).length == this._search.split(/\s+/).length)
flags |= RedisplayFlags.SUBSEARCH;
}
this._search = lowertext;