diff options
| author | Stephen Blott | 2015-05-13 06:22:56 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-05-13 06:25:49 +0100 | 
| commit | 895d6c47f71b1f5cf4eb506573b742a6748fb299 (patch) | |
| tree | 4ff9f59d4b412b649368e855d6df179ebd2ed754 /background_scripts/completion_search.coffee | |
| parent | 117b233ed5242cf0a144186ead860117f0a7cc83 (diff) | |
| download | vimium-895d6c47f71b1f5cf4eb506573b742a6748fb299.tar.bz2 | |
Search completion; minor changes.
Diffstat (limited to 'background_scripts/completion_search.coffee')
| -rw-r--r-- | background_scripts/completion_search.coffee | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/background_scripts/completion_search.coffee b/background_scripts/completion_search.coffee index b6514cd2..a9521a3d 100644 --- a/background_scripts/completion_search.coffee +++ b/background_scripts/completion_search.coffee @@ -69,7 +69,7 @@ CompletionSearch =        return callback @completionCache.get completionCacheKey      # If the user appears to be typing a continuation of the characters of the most recent query, then we can -    # re-use the previous suggestions. +    # sometimes re-use the previous suggestions.      if @mostRecentQuery? and @mostRecentSuggestions?        reusePreviousSuggestions = do =>          # Verify that the previous query is a prefix of the current query. @@ -84,7 +84,8 @@ CompletionSearch =          console.log "reuse previous query:", @mostRecentQuery if @debug          return callback @completionCache.set completionCacheKey, @mostRecentSuggestions -    # That's all of the caches we can try.  Bail if the caller is looking for synchronous results. +    # That's all of the caches we can try.  Bail if the caller is only requesting synchronous results.  We +    # signal that we haven't found a match by returning null.      return callback null if returnResultsOnlyFromCache      # We pause in case the user is still typing. @@ -113,13 +114,13 @@ CompletionSearch =                console.log "fail", url if @debug              callback suggestions +            delete @inTransit[completionCacheKey]          # ... then use the suggestions.          @inTransit[completionCacheKey].use (suggestions) =>            @mostRecentQuery = query            @mostRecentSuggestions = suggestions            callback @completionCache.set completionCacheKey, suggestions -          delete @inTransit[completionCacheKey]    # Cancel any pending (ie. blocked on @delay) queries.  Does not cancel in-flight queries.  This is called    # whenever the user is typing. | 
