diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2024-06-20 14:48:06 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2024-11-14 13:23:11 +0100 |
commit | de48fbbd5f8800bd7f1909a6fb41e53e871cf74c (patch) | |
tree | b394143235cc15259d6bf8b08729da73d5633ba4 /runtime/doc | |
parent | 7d771c3eeef5b4dca9ebc5ed6f7ca03f2b26b6bc (diff) | |
download | rneovim-de48fbbd5f8800bd7f1909a6fb41e53e871cf74c.tar.gz rneovim-de48fbbd5f8800bd7f1909a6fb41e53e871cf74c.tar.bz2 rneovim-de48fbbd5f8800bd7f1909a6fb41e53e871cf74c.zip |
fix(messages)!: vim.ui_attach message callbacks are unsafe
Problem: Lua callbacks for "msg_show" events with vim.ui_attach() are
executed when it is not safe.
Solution: Disallow non-fast API calls for "msg_show" event callbacks.
Automatically detach callback after excessive errors.
Make sure fast APIs do not modify Nvim state.
Diffstat (limited to 'runtime/doc')
-rw-r--r-- | runtime/doc/lua.txt | 4 | ||||
-rw-r--r-- | runtime/doc/news.txt | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt index 6ae1a1a3b8..e6f7e62e02 100644 --- a/runtime/doc/lua.txt +++ b/runtime/doc/lua.txt @@ -1083,6 +1083,10 @@ vim.ui_attach({ns}, {options}, {callback}) *vim.ui_attach()* |ui-popupmenu| and the sections below for event format for respective events. + Callbacks for `msg_show` events are executed in |api-fast| context. + + Excessive errors inside the callback will result in forced detachment. + WARNING: This api is considered experimental. Usability will vary for different screen elements. In particular `ext_messages` behavior is subject to further changes and usability improvements. This is expected to diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 41b9d623a2..6056c80265 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -72,7 +72,8 @@ EDITOR EVENTS -• TODO +• |vim.ui_attach()| callbacks for |ui-messages| `msg_show` events are executed in + |api-fast| context. LSP |