neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 6a330f893bf15ecab99f1fc796029c7bdba71139
parent 1b3abfa688865d95b85c27d3e523c087669604a2
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sun, 31 Aug 2025 06:44:23 +0800

fix(lua): report error in Lua Funcref callback properly (#35555)


Diffstat:
Msrc/nvim/lua/executor.c | 2+-
Mtest/functional/lua/luaeval_spec.lua | 3+++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c @@ -1496,7 +1496,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 @@ -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) @@ -289,6 +290,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()