diff options
| author | luukvbaal <luukvbaal@gmail.com> | 2026-05-12 22:28:54 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-12 16:28:54 -0400 |
| commit | de67f93aeaa24165cd344ae2d8854713d2b78a1c (patch) | |
| tree | 784caf9089375ee3cdc4687c49cc1dac9e0567b9 /src/nvim/lua/executor.c | |
| parent | a977e1077be262563197049576e03f40949db6c3 (diff) | |
| download | rneovim-de67f93aeaa24165cd344ae2d8854713d2b78a1c.tar.gz rneovim-de67f93aeaa24165cd344ae2d8854713d2b78a1c.tar.bz2 rneovim-de67f93aeaa24165cd344ae2d8854713d2b78a1c.zip | |
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.
Diffstat (limited to 'src/nvim/lua/executor.c')
| -rw-r--r-- | src/nvim/lua/executor.c | 3 |
1 files changed, 3 insertions, 0 deletions
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); } |