fix(lua): use even safer and even better error() message conversion

problem:
this crashes neovim:

ondska = setmetatable({}, {__tostring = error})
error(ondska)

solution:

make it not crash neovim
This commit is contained in:
bfredl
2026-05-20 21:02:00 +02:00
parent 526ae1cc1b
commit 24e23de721
7 changed files with 41 additions and 23 deletions

View File

@@ -828,7 +828,7 @@ describe('nvim_create_user_command', function()
})
]])
feed(':Test <Tab>')
eq('E5108: Lua function: [NULL]', api.nvim_get_vvar('errmsg'))
eq('E5108: Lua function: nil', api.nvim_get_vvar('errmsg'))
eq('Test ', fn.getcmdline())
assert_alive()
end)