aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/if_lua.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt
index f886fd28c5..7ddcb6cc92 100644
--- a/runtime/doc/if_lua.txt
+++ b/runtime/doc/if_lua.txt
@@ -400,7 +400,8 @@ is safe to execute API methods. >
end))
A subset of the API is available in direct luv callbacks ("fast" callbacks),
-most notably |nvim_get_mode()| and |nvim_input()|.
+most notably |nvim_get_mode()| and |nvim_input()|. It is possible to
+check whether code is running in this context using |vim.in_fast_event()|.
Example: repeating timer
@@ -462,6 +463,14 @@ vim.schedule({callback}) *vim.schedule()*
Schedules {callback} to be invoked soon by the main event-loop. Useful
to avoid |textlock| or other temporary restrictions.
+vim.in_fast_event() *vim.in_fast_event()*
+ Returns true if the code is executing as part of a "fast" event
+ handler, where most of the API is disabled. These are low-level event
+ such as luv callbacks |lua-loop-callbacks|, which can be invoked at
+ any time nvim polls for input. When this returns `false` most API
+ functions are callable, but can be subjected to other restrictions,
+ such as |textlock|.
+
vim.type_idx *vim.type_idx*
Type index for use in |lua-special-tbl|. Specifying one of the
values from |vim.types| allows typing the empty table (it is