aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/completion_engines.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-05-10 11:48:38 +0100
committerStephen Blott2015-05-10 11:48:38 +0100
commitcdf87b7a870303df9baee7161b15362242f65dcb (patch)
treed45f573134f5ad44e5c34f2df14cfa52a7e701b2 /background_scripts/completion_engines.coffee
parent52fbd19e24ae5679d9a2cdb7f1fa16b83c40e308 (diff)
downloadvimium-cdf87b7a870303df9baee7161b15362242f65dcb.tar.bz2
Search completion; strip duplicated code.
Diffstat (limited to 'background_scripts/completion_engines.coffee')
-rw-r--r--background_scripts/completion_engines.coffee18
1 files changed, 0 insertions, 18 deletions
diff --git a/background_scripts/completion_engines.coffee b/background_scripts/completion_engines.coffee
index 78782513..51799971 100644
--- a/background_scripts/completion_engines.coffee
+++ b/background_scripts/completion_engines.coffee
@@ -213,24 +213,6 @@ CompletionEngines =
return null if returnResultsOnlyFromCache
- if @mostRecentQuery? and @mostRecentSuggestions?
- # 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()
- previousSuggestions = @mostRecentSuggestions.map (s) -> s.toLowerCase()
- return false unless query.length <= Utils.longestCommonPrefix previousSuggestions
- true
-
- if reusePreviousSuggestions
- console.log "reuse previous query", @mostRecentQuery if @debug
- @mostRecentQuery = queryTerms.join " "
- return callback @completionCache.set completionCacheKey, @mostRecentSuggestions
-
- return null if returnResultsOnlyFromCache
-
fetchSuggestions = (engine, callback) =>
url = engine.getUrl queryTerms
query = queryTerms.join(" ").toLowerCase()