diff options
author | Lewis Russell <lewis6991@gmail.com> | 2023-11-21 11:24:30 +0000 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2023-11-27 09:09:21 +0000 |
commit | 84bbe4b0ca935db1f6202db339aee5594a3b3908 (patch) | |
tree | f71a1a2d3ab75f1b1deece31065e80c46b1b842e /runtime/lua/vim/_meta/builtin.lua | |
parent | 6343d414369de1f3b259e51438cd4f666d82d3d2 (diff) | |
download | rneovim-84bbe4b0ca935db1f6202db339aee5594a3b3908.tar.gz rneovim-84bbe4b0ca935db1f6202db339aee5594a3b3908.tar.bz2 rneovim-84bbe4b0ca935db1f6202db339aee5594a3b3908.zip |
fix(lua): disallow vim.wait() in fast contexts
`vim.wait()` cannot be called in a fast callback since the main loop
cannot be run in that context as it is not reentrant
Fixes #26122
Diffstat (limited to 'runtime/lua/vim/_meta/builtin.lua')
-rw-r--r-- | runtime/lua/vim/_meta/builtin.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/runtime/lua/vim/_meta/builtin.lua b/runtime/lua/vim/_meta/builtin.lua index 92c23f7764..eeba356672 100644 --- a/runtime/lua/vim/_meta/builtin.lua +++ b/runtime/lua/vim/_meta/builtin.lua @@ -205,6 +205,8 @@ function vim.schedule(fn) end --- milliseconds (default 200). Nvim still processes other events during --- this time. --- +--- Cannot be called while in an |api-fast| event. +--- --- Examples: --- --- ```lua @@ -235,8 +237,6 @@ function vim.schedule(fn) end --- @param callback? fun(): boolean Optional callback. Waits until {callback} returns true --- @param interval? integer (Approximate) number of milliseconds to wait between polls --- @param fast_only? boolean If true, only |api-fast| events will be processed. ---- If called from while in an |api-fast| event, will ---- automatically be set to `true`. --- @return boolean, nil|-1|-2 --- - If {callback} returns `true` during the {time}: `true, nil` --- - If {callback} never returns `true` during the {time}: `false, -1` |