aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-05-08 05:56:53 +0100
committerStephen Blott2015-05-08 05:56:53 +0100
commit4bb739c30f22be39ece9813312ca7219619a9347 (patch)
tree4ccbd9b550de30e5fb3f6c0af5f4e19ff170cc15
parent430bdc8bdf7c109a3007104fc06abeeed1891529 (diff)
downloadvimium-4bb739c30f22be39ece9813312ca7219619a9347.tar.bz2
Search completion; do not refetch on duplicate queries.
-rw-r--r--pages/vomnibar.coffee8
1 files changed, 6 insertions, 2 deletions
diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee
index ff585a5e..ae61ca9d 100644
--- a/pages/vomnibar.coffee
+++ b/pages/vomnibar.coffee
@@ -240,8 +240,12 @@ class BackgroundCompleter
@mostRecentCallback results
filter: (query, @mostRecentCallback) ->
- @messageId = Utils.createUniqueId()
- @port.postMessage name: @name, handler: "filter", id: @messageId, query: query
+ # Ignore identical consecutive queries. This can happen, for example, if the user adds a <SPACE> to the
+ # query.
+ unless @mostRecentQuery? and query == @mostRecentQuery
+ @mostRecentQuery = query
+ @messageId = Utils.createUniqueId()
+ @port.postMessage name: @name, handler: "filter", id: @messageId, query: query
refresh: ->
@port.postMessage name: @name, handler: "refresh"