fix: vim.loop in luv threads (#23924)

Fixes #23914
This commit is contained in:
Lewis Russell 2023-06-05 19:08:01 +01:00 committed by GitHub
parent cbbda3bcd7
commit c1ee187f82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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");