diff options
| -rw-r--r-- | background_scripts/completion.coffee | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 3238f744..7dbd2e61 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -484,8 +484,12 @@ class SearchEngineCompleter filter = (suggestions) -> suggestions.filter (suggestion) -> # We only keep suggestions which either *were* generated by this completion engine, or *could have - # been* generated by this completion engine. - suggestion.isSearchSuggestion or suggestion.isCustomSearch or Utils.extractQuery searchUrl, suggestion.url + # been* generated by this completion engine (and match the current query). + suggestion.isSearchSuggestion or suggestion.isCustomSearch or + ( + terms = Utils.extractQuery searchUrl, suggestion.url + terms and RankingUtils.matches queryTerms, terms + ) # If a previous suggestion still matches the query, then we keep it (even if the completion engine may not # return it for the current query). This allows the user to pick suggestions by typing fragments of their |
