Bug 571203 - Handle spaces in overlay search

Previously we were stripping all whitespace.  Instead, just strip leading+trailing
whitespace, split the remaining search into individual terms which we search
for independently.

Items are grouped by the number of terms they match, then sorted
alphabetically.
This commit is contained in:
Colin Walters
2009-02-10 14:12:13 -05:00
parent 2d3988c5fc
commit 85dae56a31
4 changed files with 68 additions and 40 deletions

View File

@@ -119,7 +119,8 @@ Sideshow.prototype = {
if (me._searchQueued)
return;
Mainloop.timeout_add(250, function() {
let text = me._searchEntry.text.replace(/\s/g, "");
// Strip leading and trailing whitespace
let text = me._searchEntry.text.replace(/^\s+/g, "").replace(/\s+$/g, "");
me._searchQueued = false;
me._searchActive = text != '';
me._appDisplay.setSearch(text);