From 094753c5a536ebacdaa3f811d198595ef2c67d24 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 30 Dec 2014 16:57:27 +0000 Subject: Delay recognising query as search-engine query. --- background_scripts/completion.coffee | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 4e570313..5cab54ed 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -324,7 +324,7 @@ class SearchEngineCompleter searchEngines: {} filter: (queryTerms, onComplete) -> - {url: url, description: description} = this.getSearchEngineMatches(queryTerms[0]) + {url: url, description: description} = @getSearchEngineMatches queryTerms suggestions = [] if url url = url.replace(/%s/g, Utils.createSearchQuery queryTerms[1..]) @@ -343,8 +343,8 @@ class SearchEngineCompleter refresh: -> this.searchEngines = root.Settings.getSearchEngines() - getSearchEngineMatches: (queryTerm) -> - this.searchEngines[queryTerm] || {} + getSearchEngineMatches: (queryTerms) -> + if 1 < queryTerms.length and engine = @searchEngines[queryTerms[0]] then engine else {} # A completer which calls filter() on many completers, aggregates the results, ranks them, and returns the top # 10. Queries from the vomnibar frontend script come through a multi completer. -- cgit v1.2.3