diff options
| author | Stephen Blott | 2015-05-08 05:56:53 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-05-08 05:56:53 +0100 |
| commit | 4bb739c30f22be39ece9813312ca7219619a9347 (patch) | |
| tree | 4ccbd9b550de30e5fb3f6c0af5f4e19ff170cc15 | |
| parent | 430bdc8bdf7c109a3007104fc06abeeed1891529 (diff) | |
| download | vimium-4bb739c30f22be39ece9813312ca7219619a9347.tar.bz2 | |
Search completion; do not refetch on duplicate queries.
| -rw-r--r-- | pages/vomnibar.coffee | 8 |
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" |
