diff options
| author | Stephen Blott | 2015-06-03 06:02:12 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-06-03 06:02:12 +0100 |
| commit | a402606774b8fe3bb04203f873804d61944553d6 (patch) | |
| tree | 8b29ca7f1fcc289aa6696638f08f8ccb1f31173e /background_scripts | |
| parent | 8ae866667f7bce9b1bca30118b5b597c5fbe24d8 (diff) | |
| download | vimium-a402606774b8fe3bb04203f873804d61944553d6.tar.bz2 | |
Only offer suggestions from the current custom search engine.
When the user changes custom search engine during a single vomnibar
activation, we should only offer suggestions which match the current
search engine (not the previous one).
We now do this not just by checking that the suggestion is a custom
search suggestion, but by checking that the actual search URL matches.
Diffstat (limited to 'background_scripts')
| -rw-r--r-- | background_scripts/completion.coffee | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 0fe95cf1..cbc5e698 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -463,7 +463,7 @@ class SearchEngineCompleter suggestions.filter (suggestion) -> # We only keep suggestions which either *were* generated by this search engine, or *could have # been* generated by this search engine (and match the current query). - suggestion.isSearchSuggestion or suggestion.isCustomSearch or + suggestion.searchUrl == searchUrl or ( terms = Utils.extractQuery searchUrl, suggestion.url terms and RankingUtils.matches queryTerms, terms @@ -488,6 +488,7 @@ class SearchEngineCompleter type: description url: Utils.createSearchUrl queryTerms, searchUrl title: queryTerms.join " " + searchUrl: searchUrl relevancy: 2.0 autoSelect: true highlightTerms: false @@ -505,6 +506,7 @@ class SearchEngineCompleter type: description url: url title: suggestion + searchUrl: searchUrl insertText: suggestion highlightTerms: false highlightTermsExcludeUrl: true |
