mirror of https://github.com/folke/lazy.nvim.git
fix(cache): dont keep invalid entries in the cache (cleanup)
This commit is contained in:
parent
d3a963d51c
commit
9fa62ea8ea
|
@ -144,9 +144,14 @@ function M.loader(modname)
|
|||
local entry = M.cache[modname]
|
||||
|
||||
local chunk, err
|
||||
if entry and M.check_path(modname, entry.modpath) then
|
||||
M.stats.find.total = M.stats.find.total + 1
|
||||
chunk, err = M.load(modname, entry.modpath)
|
||||
if entry then
|
||||
if M.check_path(modname, entry.modpath) then
|
||||
M.stats.find.total = M.stats.find.total + 1
|
||||
chunk, err = M.load(modname, entry.modpath)
|
||||
else
|
||||
M.cache[modname] = nil
|
||||
M.dirty = true
|
||||
end
|
||||
end
|
||||
if not chunk then
|
||||
-- find the modpath and load the module
|
||||
|
|
Loading…
Reference in New Issue