aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/CMakeLists.txt1
-rw-r--r--src/nvim/lua/executor.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 8abc43c2aa..77c5bf59e4 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -383,6 +383,7 @@ endif()
# Put these last on the link line, since multiple things may depend on them.
list(APPEND NVIM_LINK_LIBRARIES
+ ${LIBLUV_LIBRARIES}
${LIBUV_LIBRARIES}
${MSGPACK_LIBRARIES}
${LIBVTERM_LIBRARIES}
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c
index df08a9dd87..8cb282356a 100644
--- a/src/nvim/lua/executor.c
+++ b/src/nvim/lua/executor.c
@@ -31,6 +31,8 @@
#include "nvim/lua/executor.h"
#include "nvim/lua/converter.h"
+#include "luv/luv.h"
+
typedef struct {
Error err;
String lua_err_str;
@@ -176,6 +178,11 @@ static int nlua_state_init(lua_State *const lstate) FUNC_ATTR_NONNULL_ALL
lua_pushcfunction(lstate, &nlua_schedule);
lua_setfield(lstate, -2, "schedule");
+ // vim.loop
+ luv_set_loop(lstate, &main_loop.uv);
+ luaopen_luv(lstate);
+ lua_setfield(lstate, -2, "loop");
+
lua_setglobal(lstate, "vim");
return 0;
}