diff options
| author | Stephen Blott | 2015-05-27 09:27:07 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-27 09:27:07 +0100 |
| commit | 0eae69d6cb9b37fe0a41c16888f8af85197e42aa (patch) | |
| tree | 62691f738795fb340c20af0b4fd54d84aceb1e28 | |
| parent | e27da85676a9d62145ed7ef56e125de2e133ae10 (diff) | |
| download | vimium-0eae69d6cb9b37fe0a41c16888f8af85197e42aa.tar.bz2 | |
Custom-only: verify match on query terms alone.
| -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 |
