diff options
author | George Zhao <zhaozg@gmail.com> | 2019-06-10 20:13:18 +0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-06-10 14:13:18 +0200 |
commit | c83926cd0aa5720e88e84fa3fae3c0e689cca3ef (patch) | |
tree | b0511481bce7d76b4dfe91b1bdc6d626eeeb5f40 /src/nvim/lua/executor.c | |
parent | 3e58e60568c2acc765f3ee72295e2f15baa3cf52 (diff) | |
download | rneovim-c83926cd0aa5720e88e84fa3fae3c0e689cca3ef.tar.gz rneovim-c83926cd0aa5720e88e84fa3fae3c0e689cca3ef.tar.bz2 rneovim-c83926cd0aa5720e88e84fa3fae3c0e689cca3ef.zip |
lua: introduce vim.loop (expose libuv event-loop) #10123
Co-authored-by: Andrey Popp <8mayday@gmail.com>
closes #9546
closes #10084
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 7 |
1 files changed, 7 insertions, 0 deletions
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; } |