From 979592bda3d471cbe509d1166b348ffbcf66a7f3 Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 15 Aug 2022 21:08:20 +0200 Subject: docs: note that event handlers may be executed outside of the main loop (#297) --- doc/reference.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/reference.md') diff --git a/doc/reference.md b/doc/reference.md index 25496863..c16f2e0e 100644 --- a/doc/reference.md +++ b/doc/reference.md @@ -390,6 +390,9 @@ to events on the associated object. Registers the provided `{handler}`, to be called every time the provided `{event}` is dispatched. +**Note**: The provided `{handler}` may be executed outside the main Neovim loop (`:h vim.in_fast_event()`), where most of +the Neovim API is disabled. + ### `EventEmitter:once({event, handler})` **Parameters:** @@ -400,6 +403,9 @@ Registers the provided `{handler}`, to be called every time the provided Registers the provided `{handler}`, to be called only once - the next time the provided `{event}` is dispatched. +**Note**: The provided `{handler}` may be executed outside the main Neovim loop (`:h vim.in_fast_event()`), where most of +the Neovim API is disabled. + ### `EventEmitter:off({event}, {handler})` **Parameters:** -- cgit v1.2.3-70-g09d2