From 7b8935398587992da3233bcd7edd79013889fea4 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 6 Oct 2020 12:58:05 -0400 Subject: lua: vim.wait allows control of fast events (#13053) * lua: vim.wait allows control of fast events * fixup: remove requirement of function for easier waiting * fixup: lint * fixup: bfredl comments --- runtime/doc/lua.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'runtime') diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 2b638a8539..a53024d420 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -737,13 +737,20 @@ vim.defer_fn({fn}, {timeout}) *vim.defer_fn* Returns: ~ |vim.loop|.new_timer() object -vim.wait({time}, {callback} [, {interval}]) *vim.wait()* +vim.wait({time} [, {callback}, {interval}, {fast_only}]) *vim.wait()* Wait for {time} in milliseconds until {callback} returns `true`. Executes {callback} immediately and at approximately {interval} milliseconds (default 200). Nvim still processes other events during this time. + Parameters: ~ + {time} Number of milliseconds to wait + {callback} Optional callback. Waits until {callback} returns true + {interval} (Approximate) number of milliseconds to wait between polls + {fast_only} If true, only |api-fast| events will be processed. + If called from while in an |api-fast| event, will + automatically be set to `true`. Returns: ~ If {callback} returns `true` during the {time}: -- cgit