diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 497dfa2761..d154b5896f 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1493,7 +1493,7 @@ int typval_exec_lua_callable(LuaRef lua_cb, int argcount, typval_T *argvars, typ PUSH_ALL_TYPVALS(lstate, argvars, argcount, false); if (nlua_pcall(lstate, argcount, 1)) { - nlua_print(lstate); + nlua_error(lstate, _("Lua callback: %.*s")); return FCERR_OTHER; } diff --git a/test/functional/lua/luaeval_spec.lua b/test/functional/lua/luaeval_spec.lua index 5fea79141c..dd817ae963 100644 --- a/test/functional/lua/luaeval_spec.lua +++ b/test/functional/lua/luaeval_spec.lua @@ -16,6 +16,7 @@ local feed = n.feed local assert_alive = n.assert_alive local NIL = vim.NIL local eq = t.eq +local matches = t.matches before_each(clear) @@ -266,6 +267,8 @@ describe('luaeval()', function() return true ]]) + -- v:errmsg is set properly #35554 + matches(': dead function\n', api.nvim_get_vvar('errmsg')) end) it('should handle passing functions around', function()