From a402606774b8fe3bb04203f873804d61944553d6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 3 Jun 2015 06:02:12 +0100 Subject: 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. --- background_scripts/completion.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3