mirror of https://github.com/folke/lazy.nvim.git
revert: fix(loader): add auto loaded module to package.loaded early to prevent require loops
This reverts commit 18d1c1b47e
.
This commit is contained in:
parent
8bef0742a2
commit
a692bf8688
|
@ -552,17 +552,16 @@ function M.loader(modname)
|
||||||
end
|
end
|
||||||
|
|
||||||
if ret then
|
if ret then
|
||||||
local mod = package.loaded[modname]
|
|
||||||
if type(mod) ~= "table" then
|
|
||||||
mod = loadfile(ret.modpath, nil, nil, ret.stat)()
|
|
||||||
end
|
|
||||||
package.loaded[modname] = mod
|
|
||||||
M.auto_load(modname, ret.modpath)
|
M.auto_load(modname, ret.modpath)
|
||||||
-- selene: allow(incorrect_standard_library_use)
|
local mod = package.loaded[modname]
|
||||||
|
if type(mod) == "table" then
|
||||||
return function()
|
return function()
|
||||||
return mod
|
return mod
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- selene: allow(incorrect_standard_library_use)
|
||||||
|
return loadfile(ret.modpath, nil, nil, ret.stat)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
Loading…
Reference in New Issue