From 9fe22a3c72c64ae61c6b155efaeaa2e2125e199d Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 13 May 2015 11:14:35 +0100 Subject: Domain completer: no completions for "w ". If the input is "w ", the user is going for something like "w query terms" (a custom search engine). So the domain completer should not offer completions if the user has finished the first word. --- background_scripts/completion.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'background_scripts') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index bf88f10e..db151bed 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -232,7 +232,8 @@ class DomainCompleter domains: null filter: ({ queryTerms, query }, onComplete) -> - return onComplete [] unless queryTerms.length == 1 and not /\s$/.test query + # Do not offer completions if the query is empty, or if the user has finished typing the first word. + return onComplete [] if queryTerms.length == 0 or /\S\s/.test query if @domains @performSearch(queryTerms, onComplete) else -- cgit v1.2.3