aboutsummaryrefslogtreecommitdiff
path: root/src/nlua0.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2023-04-20 14:41:47 +0200
committerbfredl <bjorn.linse@gmail.com>2023-04-20 19:00:38 +0200
commitffaf74f1477d3182ffc70bcc9913effc44c90ea7 (patch)
treea42c9984fb7564e57c79a1c47fb8f18275f614e6 /src/nlua0.c
parentdbcd1985d13b02ab7a547d0b97d4ede28fa49b96 (diff)
downloadrneovim-ffaf74f1477d3182ffc70bcc9913effc44c90ea7.tar.gz
rneovim-ffaf74f1477d3182ffc70bcc9913effc44c90ea7.tar.bz2
rneovim-ffaf74f1477d3182ffc70bcc9913effc44c90ea7.zip
fix(build): distinguish vim.mpack from global require'mpack'
problem: the api of vim.mpack is not compatible with a system provided mpack solution: don't require 'mpack' directly from the system path
Diffstat (limited to 'src/nlua0.c')
-rw-r--r--src/nlua0.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nlua0.c b/src/nlua0.c
new file mode 100644
index 0000000000..af811df324
--- /dev/null
+++ b/src/nlua0.c
@@ -0,0 +1,13 @@
+#include <lua.h>
+
+#include "mpack/lmpack.h"
+
+LUA_API int luaopen_nlua0(lua_State* L);
+
+LUA_API int luaopen_nlua0(lua_State* L) {
+ lua_getglobal(L, "vim");
+ luaopen_mpack(L);
+ lua_setfield(L, -2, "mpack");
+
+ return 1;
+}