mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
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:
@@ -594,10 +594,12 @@ ArrayOf(String) nvim_get_runtime_file(String name, Boolean all, Arena *arena, Er
|
||||
kvi_init(cookie.rv);
|
||||
|
||||
int flags = DIP_DIRFILE | (all ? DIP_ALL : 0);
|
||||
TryState tstate;
|
||||
|
||||
try_enter(&tstate);
|
||||
do_in_runtimepath((name.size ? name.data : ""), flags, find_runtime_cb, &cookie);
|
||||
vim_ignored = try_leave(&tstate, err);
|
||||
|
||||
TRY_WRAP(err, {
|
||||
do_in_runtimepath((name.size ? name.data : ""), flags, find_runtime_cb, &cookie);
|
||||
});
|
||||
return arena_take_arraybuilder(arena, &cookie.rv);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user