diff options
| author | luukvbaal <luukvbaal@gmail.com> | 2026-01-27 15:30:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-27 09:30:37 -0500 |
| commit | 1d57374c41e6c46c41d537c342ce30ad96cdb85b (patch) | |
| tree | 3b9d6f770c56bbb44e29bdad625cbd59d8adf321 /src/nvim/lua/executor.c | |
| parent | c2ecc9ca41a95b1644cae183fd19ce49ce10f980 (diff) | |
| download | rneovim-1d57374c41e6c46c41d537c342ce30ad96cdb85b.tar.gz rneovim-1d57374c41e6c46c41d537c342ce30ad96cdb85b.tar.bz2 rneovim-1d57374c41e6c46c41d537c342ce30ad96cdb85b.zip | |
fix(ui): textlock still causes issues for UI callbacks #37513
Problem: There are still ways to run into textlock errors with
vim.ui_attach callbacks trying to display a UI event.
Solution: Disregard textlock again during vim.ui_attach() callbacks
(also when scheduled). Partially revert 3277dc3b; avoiding
to flush while textlock is set is still helpful.
Diffstat (limited to 'src/nvim/lua/executor.c')
| -rw-r--r-- | src/nvim/lua/executor.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index e047c051f7..78d4515057 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -382,10 +382,18 @@ static void nlua_schedule_event(void **argv) lua_State *const lstate = global_lstate; nlua_pushref(lstate, cb); nlua_unref_global(lstate, cb); + + // Don't impose textlock restrictions upon UI event handlers. + int save_expr_map_lock = expr_map_lock; + int save_textlock = textlock; + expr_map_lock = ns_id > 0 ? 0 : expr_map_lock; + textlock = ns_id > 0 ? 0 : textlock; if (nlua_pcall(lstate, 0, 0)) { nlua_error(lstate, _("vim.schedule callback: %.*s")); ui_remove_cb(ns_id, true); } + expr_map_lock = save_expr_map_lock; + textlock = save_textlock; } /// Schedule Lua callback on main loop's event queue |