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.
This commit is contained in:
Luuk van Baal
2024-06-20 14:48:06 +02:00
parent 7d771c3eee
commit de48fbbd5f
17 changed files with 215 additions and 141 deletions

View File

@@ -750,7 +750,7 @@ local function process_function(fn)
write_shifted_output(
[[
if (!nlua_is_deferred_safe()) {
return luaL_error(lstate, e_luv_api_disabled, "%s");
return luaL_error(lstate, e_fast_api_disabled, "%s");
}
]],
fn.name