From de67f93aeaa24165cd344ae2d8854713d2b78a1c Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Tue, 12 May 2026 22:28:54 +0200 Subject: fix(messages): fast context for for nvim_echo({kind}) callback #39755 Problem: vim.ui_attach() callback for nvim_echo() call that spoofs an internal message kind is executed in fast context. Solution: Set msg_show callback |api-fast| context dynamically at external message callsites, and for internal list_cmd", "progress" and "shell*" messages. --- src/nvim/lua/executor.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/nvim/lua/executor.c') diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index fda848e51c..199813bf4a 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -306,6 +306,7 @@ void nlua_error(lua_State *const lstate, const char *const msg) fprintf(stderr, msg, (int)len, str); fprintf(stderr, "\n"); } else { + msg_ext_no_fast(); semsg_multiline("lua_error", msg, (int)len, str); } @@ -342,6 +343,7 @@ static void nlua_luv_error_event(void **argv) luv_err_t type = (luv_err_t)(intptr_t)argv[1]; switch (type) { case kCallback: + msg_ext_no_fast(); semsg_multiline("lua_error", "Lua callback:\n%s", error); break; case kThread: @@ -1049,6 +1051,7 @@ static void nlua_print_event(void **argv) HlMessageChunk chunk = { { .data = argv[0], .size = (size_t)(intptr_t)argv[1] - 1 }, 0 }; kv_push(msg, chunk); bool needs_clear = false; + msg_ext_no_fast(); msg_multihl(NIL, msg, "lua_print", true, false, NULL, &needs_clear); } -- cgit