aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-05-03 17:22:20 +0100
committerStephen Blott2015-05-03 17:22:20 +0100
commit776f617ece5d333fe70df903982a18d65fc2776a (patch)
tree8d4fd8e22d128629df9a1998fc1f716c08b6791e /lib/utils.coffee
parent7d59e948da154203722b442c477b452f7a393161 (diff)
downloadvimium-776f617ece5d333fe70df903982a18d65fc2776a.tar.bz2
Search completion; make completion lookup asynchronous.
Diffstat (limited to 'lib/utils.coffee')
-rw-r--r--lib/utils.coffee6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee
index 5d9696e1..07528714 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -183,6 +183,12 @@ Utils =
return true if re.test string
false
+ # Convenience wrapper for setTimeout (with the arguments around the other way).
+ setTimeout: (ms, func) -> setTimeout func, ms
+
+ # Like Nodejs's nextTick.
+ nextTick: (func) -> @setTimeout 0, func
+
# This creates a new function out of an existing function, where the new function takes fewer arguments. This
# allows us to pass around functions instead of functions + a partial list of arguments.