diff options
| author | Stephen Blott | 2015-05-13 11:14:35 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-13 11:14:35 +0100 |
| commit | 9fe22a3c72c64ae61c6b155efaeaa2e2125e199d (patch) | |
| tree | 2ec51f19fbb8b56dd52e85631c9879cbd912e7f4 /background_scripts | |
| parent | 80f411ef238be2af24819e69de3e7d39760ecc1c (diff) | |
| download | vimium-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.coffee | 3 |
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 |
