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/doc | |
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/doc')
-rw-r--r-- | runtime/doc/lua.txt | 8 | ||||
-rw-r--r-- | runtime/doc/news.txt | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index a79b26dfb0..a35d70cae8 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1143,6 +1143,8 @@ vim.wait({time}, {callback}, {interval}, {fast_only}) *vim.wait()* milliseconds (default 200). Nvim still processes other events during this time. + Cannot be called while in an |api-fast| event. + Examples: >lua --- -- Wait for 100 ms, allowing other events to process @@ -1173,8 +1175,7 @@ vim.wait({time}, {callback}, {interval}, {fast_only}) *vim.wait()* • {interval} (integer|nil) (Approximate) number of milliseconds to wait between polls • {fast_only} (boolean|nil) If true, only |api-fast| events will be - processed. If called from while in an |api-fast| event, - will automatically be set to `true`. + processed. Return: ~ boolean, nil|-1|-2 @@ -1828,7 +1829,8 @@ vim.system({cmd}, {opts}, {on_exit}) *vim.system()* • pid (integer) Process ID • wait (fun(timeout: integer|nil): SystemCompleted) Wait for the process to complete. Upon timeout the process is sent the KILL - signal (9) and the exit code is set to 124. + signal (9) and the exit code is set to 124. Cannot be called in + |api-fast|. • SystemCompleted is an object with the fields: • code: (integer) • signal: (integer) diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index b5bef13325..825e5ba41f 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -325,6 +325,8 @@ The following changes to existing APIs or features add new behavior. NOTE: the regexp engine still has a hard-coded limit of considering 6 composing chars only. +• |vim.wait()| is no longer allowed to be called in |api-fast|. + ============================================================================== REMOVED FEATURES *news-removed* |