aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-06-03 06:02:12 +0100
committerStephen Blott2015-06-03 06:02:12 +0100
commita402606774b8fe3bb04203f873804d61944553d6 (patch)
tree8b29ca7f1fcc289aa6696638f08f8ccb1f31173e /background_scripts
parent8ae866667f7bce9b1bca30118b5b597c5fbe24d8 (diff)
downloadvimium-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.coffee4
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