aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-02-06 13:49:30 +0000
committerStephen Blott2015-02-06 13:49:30 +0000
commit8dd70aaa6c1044c5c8b389e61d67b72d234432d0 (patch)
treebe0565fff292cc55ef79b3f001d0802afb13d260 /background_scripts
parentb49d1bf61cfa99decf209f20e43c4a5a35f4b3d7 (diff)
parent63d4a74c54b6a70e8399aebc51c759f80b9866af (diff)
downloadvimium-8dd70aaa6c1044c5c8b389e61d67b72d234432d0.tar.bz2
Merge branch 'fix-custom-search-engine-selection'
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/completion.coffee3
1 files changed, 3 insertions, 0 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index d6402019..177892fb 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -21,6 +21,8 @@ class Suggestion
# - extraRelevancyData: data (like the History item itself) which may be used by the relevancy function.
constructor: (@queryTerms, @type, @url, @title, @computeRelevancyFunction, @extraRelevancyData) ->
@title ||= ""
+ # When @autoSelect is truthy, the suggestion is automatically pre-selected in the vomnibar.
+ @autoSelect = false
computeRelevancy: -> @relevancy = @computeRelevancyFunction(this)
@@ -335,6 +337,7 @@ class SearchEngineCompleter
type = "search"
query = queryTerms[0] + ": " + queryTerms[1..].join(" ")
suggestion = new Suggestion(queryTerms, type, url, query, @computeRelevancy)
+ suggestion.autoSelect = true
suggestions.push(suggestion)
onComplete(suggestions)