mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 12:56:46 +00:00
fix(cache): do a fast check to see if a cached modpath is still valid. find it again otherwise
This commit is contained in:
parent
1fe43f3e29
commit
32f2b71ff8
2 changed files with 63 additions and 24 deletions
|
@ -1,6 +1,7 @@
|
|||
local Util = require("lazy.core.util")
|
||||
local Config = require("lazy.core.config")
|
||||
local Handler = require("lazy.core.handler")
|
||||
local Cache = require("lazy.core.cache")
|
||||
|
||||
local M = {}
|
||||
|
||||
|
@ -214,17 +215,4 @@ function M.autoload(modname)
|
|||
return modname .. " not found in lazy plugins"
|
||||
end
|
||||
|
||||
-- lazy.cache will call this when loading a cached file with modpath set.
|
||||
---@param modname string
|
||||
---@param modpath string
|
||||
function M.check_load(modname, modpath)
|
||||
-- no need to check anything before init
|
||||
if M.init_done then
|
||||
local plugin = require("lazy.core.plugin").find(modpath)
|
||||
if plugin and not plugin._.loaded then
|
||||
M.load(plugin, { require = modname })
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue