mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +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:
@@ -1414,7 +1414,7 @@ describe('lua stdlib', function()
|
||||
screen:expect {
|
||||
grid = [[
|
||||
{9:[string "<nvim>"]:6: E5560: rpcrequest must not be}|
|
||||
{9: called in a lua loop callback} |
|
||||
{9: called in a fast event context} |
|
||||
{9:stack traceback:} |
|
||||
{9: [C]: in function 'rpcrequest'} |
|
||||
{9: [string "<nvim>"]:6: in function <[string }|
|
||||
@@ -3783,7 +3783,7 @@ stack traceback:
|
||||
end)
|
||||
]])
|
||||
screen:expect({
|
||||
any = pesc('E5560: vim.wait must not be called in a lua loop callback'),
|
||||
any = pesc('E5560: vim.wait must not be called in a fast event context'),
|
||||
})
|
||||
feed('<CR>')
|
||||
assert_alive()
|
||||
|
Reference in New Issue
Block a user