diff options
| author | bfredl <bjorn.linse@gmail.com> | 2024-11-14 18:56:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-14 18:56:56 +0100 |
| commit | 05d354e2165c2c331a33949d49095eef3503a32f (patch) | |
| tree | 1be1b0a84e056d190e5e342ec24a9b0fc166ec99 /runtime | |
| parent | 434d5936b6e92e8a5557a03adf0e35b7902645ad (diff) | |
| parent | de48fbbd5f8800bd7f1909a6fb41e53e871cf74c (diff) | |
| download | rneovim-05d354e2165c2c331a33949d49095eef3503a32f.tar.gz rneovim-05d354e2165c2c331a33949d49095eef3503a32f.tar.bz2 rneovim-05d354e2165c2c331a33949d49095eef3503a32f.zip | |
Merge pull request #27874 from luukvbaal/funcerr
fix(messages)!: vim.ui_attach message callbacks are unsafe
Diffstat (limited to 'runtime')
| -rw-r--r-- | runtime/doc/lua.txt | 4 | ||||
| -rw-r--r-- | runtime/doc/news.txt | 3 | ||||
| -rw-r--r-- | runtime/lua/vim/_meta/builtin.lua | 4 |
3 files changed, 10 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 81ebf2fb23..53a13b08cb 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 diff --git a/runtime/lua/vim/_meta/builtin.lua b/runtime/lua/vim/_meta/builtin.lua index 234c75d38f..dd6ef69eb8 100644 --- a/runtime/lua/vim/_meta/builtin.lua +++ b/runtime/lua/vim/_meta/builtin.lua @@ -233,6 +233,10 @@ function vim.wait(time, callback, interval, fast_only) end --- {callback} receives event name plus additional parameters. See |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 be |