From 413dd5b112e57bd57fbf93509cb3dcbdc430fb8d Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 26 Nov 2022 13:57:17 +0100 Subject: [PATCH] fix: dont return init.lua in lsmod --- lua/lazy/core/util.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazy/core/util.lua b/lua/lazy/core/util.lua index 7ece950..04cc245 100644 --- a/lua/lazy/core/util.lua +++ b/lua/lazy/core/util.lua @@ -135,7 +135,7 @@ end ---@param fn fun(modname:string, modpath:string) function M.lsmod(root, fn) M.ls(root, function(path, name, type) - if type == "file" and name:sub(-4) == ".lua" then + if type == "file" and name:sub(-4) == ".lua" and name ~= "init.lua" then fn(name:sub(1, -5), path) elseif type == "directory" and vim.loop.fs_stat(path .. "/init.lua") then fn(name, path .. "/init.lua")