aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2015-05-13 11:14:35 +0100
committerStephen Blott2015-05-13 11:14:35 +0100
commit9fe22a3c72c64ae61c6b155efaeaa2e2125e199d (patch)
tree2ec51f19fbb8b56dd52e85631c9879cbd912e7f4 /background_scripts
parent80f411ef238be2af24819e69de3e7d39760ecc1c (diff)
downloadvimium-9fe22a3c72c64ae61c6b155efaeaa2e2125e199d.tar.bz2
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.
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/completion.coffee3
1 files changed, 2 insertions, 1 deletions
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