mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(cache): if mod is loaded already in the loader, then return that
This commit is contained in:
parent
316503f124
commit
ffabe91b2d
2 changed files with 10 additions and 4 deletions
|
@ -88,6 +88,12 @@ function M.loader(modname)
|
|||
|
||||
local chunk, err
|
||||
if entry and M.check_path(modname, entry.modpath) then
|
||||
local mod = package.loaded[modname]
|
||||
if type(mod) == "table" then
|
||||
return function()
|
||||
return mod
|
||||
end
|
||||
end
|
||||
chunk, err = M.load(modname, entry.modpath)
|
||||
else
|
||||
-- find the modpath and load the module
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue