diff options
| author | Stephen Blott | 2015-05-10 09:49:09 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-05-10 11:46:14 +0100 | 
| commit | e56b5fc0129dd67d7978ee6453d366cb3642a4e2 (patch) | |
| tree | a7f5c689fd26d0f446fab5a32ba319fdd93cf5fb | |
| parent | 5191ee986615f45bfaedb389e3b34fd0a1ce9ca9 (diff) | |
| download | vimium-e56b5fc0129dd67d7978ee6453d366cb3642a4e2.tar.bz2 | |
Search completion; use cached suggestions synchronously.
Conflicts:
	background_scripts/completion_engines.coffee
| -rw-r--r-- | background_scripts/completion_engines.coffee | 7 | 
1 files changed, 5 insertions, 2 deletions
| diff --git a/background_scripts/completion_engines.coffee b/background_scripts/completion_engines.coffee index 729c68b0..78782513 100644 --- a/background_scripts/completion_engines.coffee +++ b/background_scripts/completion_engines.coffee @@ -214,8 +214,9 @@ CompletionEngines =      return null if returnResultsOnlyFromCache      if @mostRecentQuery? and @mostRecentSuggestions? -      # If the user appears to be typing a continuation of the characters in all of the most recent query, -      # then we can re-use the results of the previous query. +      # If the user appears to be typing a continuation of the characters of the most recent query, and those +      # characters are also common to all of the most recent suggestions, then we can re-use the previous +      # suggestions.        reusePreviousSuggestions = do (query) =>          query = queryTerms.join(" ").toLowerCase()          return false unless 0 == query.indexOf @mostRecentQuery.toLowerCase() @@ -228,6 +229,8 @@ CompletionEngines =          @mostRecentQuery = queryTerms.join " "          return callback @completionCache.set completionCacheKey, @mostRecentSuggestions +    return null if returnResultsOnlyFromCache +      fetchSuggestions = (engine, callback) =>        url = engine.getUrl queryTerms        query = queryTerms.join(" ").toLowerCase() | 
