aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vis-lua.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vis-lua.c b/vis-lua.c
index 0d9c24e..8a0f0dc 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -2567,8 +2567,10 @@ bool vis_lua_path_add(Vis *vis, const char *path) {
lua_getglobal(L, "package");
lua_pushstring(L, path);
lua_pushstring(L, "/?.lua;");
- lua_getfield(L, -3, "path");
- lua_concat(L, 3);
+ lua_pushstring(L, path);
+ lua_pushstring(L, "/?/init.lua;");
+ lua_getfield(L, -5, "path");
+ lua_concat(L, 5);
lua_setfield(L, -2, "path");
lua_pop(L, 1); /* package */
return true;