vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 45485fa830aaf62d4c2ba7d8069322e26fc6b7f6 parent 211853b880acd558268317abb3b054e3979641e8 Author: Georgi Kirilov <in.the@repo> Date: Thu, 6 Feb 2020 10:25:04 +0200 lua: add <plugin>/init.lua to package.path Diffstat:
| M | vis-lua.c | | | 6 | ++++-- |
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git 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;