add moduledir

This commit is contained in:
LAPTOP-G43MA5MO\ekarni 2024-05-12 03:03:00 +03:00
commit 741d95a52a

View file

@ -260,8 +260,13 @@ end
function M.lsmod(modname, fn) function M.lsmod(modname, fn)
local root = M.find_root(modname) local root = M.find_root(modname)
if not root then if not root then
local Config = require("lazy.core.config")
if Config.options.moduledir then
root = Config.options.moduledir .. modname
else
return return
end end
end
if vim.uv.fs_stat(root .. ".lua") then if vim.uv.fs_stat(root .. ".lua") then
fn(modname, root .. ".lua") fn(modname, root .. ".lua")