mirror of
https://github.com/neovim/neovim.git
synced 2026-04-30 11:14:10 +00:00
fix(normal): crash using :norm from vim.ui_attach shell message event #38283
Problem: 'showcmd' buffer is being populated for :norm commands, which
can result in a recursive uv_run() when called from a msg_show
vim.ui_attach callback for a shell message.
Solution: The 'showcmd' buffer is never displayed while executing a
:normal command so prevent unnecessary work, avoiding the crash.
This commit is contained in:
@@ -404,6 +404,18 @@ describe('vim.ui_attach', function()
|
||||
feed('<Esc>:<Tab>')
|
||||
n.assert_alive()
|
||||
end)
|
||||
|
||||
it("does not crash with :norm 'showcmd' from shell message callback #38233", function()
|
||||
exec_lua(function()
|
||||
vim.ui_attach(vim.api.nvim_create_namespace(''), { ext_messages = true }, function(event)
|
||||
if event == 'msg_show' then
|
||||
vim.api.nvim_command('norm! G')
|
||||
end
|
||||
end)
|
||||
end)
|
||||
n.command('set showcmd | !echo "foo"')
|
||||
n.assert_alive()
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('vim.ui_attach', function()
|
||||
|
||||
Reference in New Issue
Block a user