diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-04-27 12:06:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-27 12:06:44 +0200 |
commit | 0ff58d1bb944c9b43394ac7c83d8785c9bab6722 (patch) | |
tree | a6d05e3d36c00b6162775049442a60fc1ef6b9f8 /src/nvim/lua/stdlib.c | |
parent | d321deb4a9b05e9d81b79ac166274f4a6e7981bf (diff) | |
parent | 45bcf8386918bbb475fbe20c48b508aa89ed0624 (diff) | |
download | rneovim-0ff58d1bb944c9b43394ac7c83d8785c9bab6722.tar.gz rneovim-0ff58d1bb944c9b43394ac7c83d8785c9bab6722.tar.bz2 rneovim-0ff58d1bb944c9b43394ac7c83d8785c9bab6722.zip |
Merge pull request #23216 from bfredl/lpeg
refactor(build): include lpeg as a library
Diffstat (limited to 'src/nvim/lua/stdlib.c')
-rw-r--r-- | src/nvim/lua/stdlib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/lua/stdlib.c b/src/nvim/lua/stdlib.c index f53493e088..cf90420586 100644 --- a/src/nvim/lua/stdlib.c +++ b/src/nvim/lua/stdlib.c @@ -611,6 +611,19 @@ void nlua_state_add_stdlib(lua_State *const lstate, bool is_thread) lua_setfield(lstate, -2, "mpack"); lua_pop(lstate, 3); + // vim.lpeg + int luaopen_lpeg(lua_State *); + luaopen_lpeg(lstate); + lua_pushvalue(lstate, -1); + lua_setfield(lstate, -4, "lpeg"); + + // package.loaded.lpeg = vim.lpeg + lua_getglobal(lstate, "package"); + lua_getfield(lstate, -1, "loaded"); + lua_pushvalue(lstate, -3); + lua_setfield(lstate, -2, "lpeg"); + lua_pop(lstate, 4); + // vim.diff lua_pushcfunction(lstate, &nlua_xdl_diff); lua_setfield(lstate, -2, "diff"); |