aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-05-05 14:27:41 +0100
committerStephen Blott2015-05-05 14:27:41 +0100
commite21896e2af7f28eb17b5b98a32cfce32fe171d3a (patch)
treeade70fccb2442ea13bff8a7b160c638c19b370d5
parent1a9ea85f683c892592d7092c361e835c8b0f4f3e (diff)
downloadvimium-e21896e2af7f28eb17b5b98a32cfce32fe171d3a.tar.bz2
Search completion; rework asynchronous lookups.
-rw-r--r--pages/vomnibar.coffee11
1 files changed, 5 insertions, 6 deletions
diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee
index ff004c6e..58513dc2 100644
--- a/pages/vomnibar.coffee
+++ b/pages/vomnibar.coffee
@@ -186,14 +186,13 @@ class VomnibarUI
@update()
update: (updateSynchronously = false, callback = null) =>
- # Cancel any scheduled update.
- if @updateTimer?
- window.clearTimeout @updateTimer
- @updateTimer = null
-
if updateSynchronously
+ # Cancel any scheduled update.
+ if @updateTimer?
+ window.clearTimeout @updateTimer
+ @updateTimer = null
@updateCompletions callback
- else
+ else if not @updateTimer?
# Update asynchronously for better user experience and to take some load off the CPU (not every
# keystroke will cause a dedicated update)
@updateTimer = Utils.setTimeout @refreshInterval, =>