diff options
| author | Stephen Blott | 2015-05-19 10:47:23 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-19 10:47:23 +0100 |
| commit | 986ba1a3c65b090955ef6c0a2d27a02eb09726e0 (patch) | |
| tree | 2bdee28f20ef7339f5aa625f905fd603a0e3819a | |
| parent | abd683d999cf0ef0d8b583733e9412af473c5dcc (diff) | |
| download | vimium-986ba1a3c65b090955ef6c0a2d27a02eb09726e0.tar.bz2 | |
Search completion; minor code review.
| -rw-r--r-- | background_scripts/completion.coffee | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 0f55e59c..a1a41feb 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -415,7 +415,7 @@ class SearchEngineCompleter request.searchEngines = engines keyword = queryTerms[0] # Note. For a keyword "w", we match "w search terms" and "w ", but not "w" on its own. - if keyword and engines[keyword] and (1 < queryTerms.length or /\s$/.test query) + if keyword and engines[keyword] and (1 < queryTerms.length or /\S\s/.test query) extend request, queryTerms: queryTerms[1..] keyword: keyword @@ -631,9 +631,7 @@ class MultiCompleter # collapsing the vomnibar briefly before expanding it again, which looks ugly. unless suggestions.length == 0 and shouldRunContinuations suggestions = @prepareSuggestions request, queryTerms, suggestions - onComplete - results: suggestions - mayCacheResults: continuations.length == 0 + onComplete results: suggestions # Run any continuations (asynchronously); for example, the search-engine completer # (SearchEngineCompleter) uses a continuation to fetch suggestions from completion engines @@ -648,11 +646,7 @@ class MultiCompleter jobs.onReady => suggestions = filter suggestions for filter in filters suggestions = @prepareSuggestions request, queryTerms, suggestions - # We post these results even if a new query has started. The vomnibar will not display them - # (because they're arriving too late), but it will cache them. - onComplete - results: suggestions - mayCacheResults: true + onComplete results: suggestions # Admit subsequent queries and launch any pending query. @filterInProgress = false |
