From c1ee187f82141d778335955c9603c69e6f4785d7 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Mon, 5 Jun 2023 19:08:01 +0100 Subject: [PATCH] fix: vim.loop in luv threads (#23924) Fixes #23914 --- src/nvim/lua/executor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 36dcb6efcf..35540de99e 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -580,6 +580,9 @@ static void nlua_common_vim_init(lua_State *lstate, bool is_thread, bool is_stan lua_pushvalue(lstate, -1); lua_setfield(lstate, -3, "uv"); + lua_pushvalue(lstate, -1); + lua_setfield(lstate, -3, "loop"); // deprecated + // package.loaded.luv = vim.uv // otherwise luv will be reinitialized when require'luv' lua_getglobal(lstate, "package");