mirror of https://github.com/folke/lazy.nvim.git
fix(cache): if mod is loaded already in the loader, then return that
This commit is contained in:
parent
316503f124
commit
ffabe91b2d
|
@ -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
|
||||
|
|
|
@ -36,10 +36,10 @@ local M = {}
|
|||
---@field pin? boolean
|
||||
|
||||
---@class LazyPlugin: LazyPluginHandlers,LazyPluginHooks,LazyPluginRef
|
||||
---@field [1] string
|
||||
---@field name string display name and name used for plugin config files
|
||||
---@field url string
|
||||
---@field dir string
|
||||
---@field [1] string?
|
||||
---@field name string? display name and name used for plugin config files
|
||||
---@field url string?
|
||||
---@field dir string?
|
||||
---@field enabled? boolean|(fun():boolean)
|
||||
---@field lazy? boolean
|
||||
---@field dev? boolean If set, then link to the respective folder under your ~/projects
|
||||
|
|
Loading…
Reference in New Issue