diff options
| author | Stephen Blott | 2015-05-09 08:37:05 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-09 08:41:41 +0100 |
| commit | 3bc555eb02b228f35647884575189eed40625c52 (patch) | |
| tree | d3ca1ac3175a4c3f44f2a06afdd3dc389bd14ba3 | |
| parent | 6fd0e15b96325222abf1a19886bd5e0fb48fcdbb (diff) | |
| download | vimium-3bc555eb02b228f35647884575189eed40625c52.tar.bz2 | |
Search completion; tweaks.
| -rw-r--r-- | background_scripts/completion.coffee | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index c1f76b81..f800c818 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -395,14 +395,16 @@ class SearchEngineCompleter # Suppress the "w" from "w query terms" in the vomnibar input. suppressLeadingKeyword: true - # Exclude results from other completers if this is a custom search engine and we have a completer. + haveCompletionEngine = CompletionEngines.haveCompletionEngine searchUrl + # If this is a custom search engine and we have a completer, then exclude results from other completers. filter = - if custom and CompletionEngines.haveCompletionEngine searchUrl + if custom and haveCompletionEngine (suggestion) -> suggestion.type == description else null - if queryTerms.length == 0 + # Post suggestions and bail if there is no prospect of adding further suggestions. + if queryTerms.length == 0 or not haveCompletionEngine return onComplete suggestions, { filter } onComplete suggestions, |
