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
|
local chunk, err
|
||||||
if entry and M.check_path(modname, entry.modpath) then
|
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)
|
chunk, err = M.load(modname, entry.modpath)
|
||||||
else
|
else
|
||||||
-- find the modpath and load the module
|
-- find the modpath and load the module
|
||||||
|
|
|
@ -36,10 +36,10 @@ local M = {}
|
||||||
---@field pin? boolean
|
---@field pin? boolean
|
||||||
|
|
||||||
---@class LazyPlugin: LazyPluginHandlers,LazyPluginHooks,LazyPluginRef
|
---@class LazyPlugin: LazyPluginHandlers,LazyPluginHooks,LazyPluginRef
|
||||||
---@field [1] string
|
---@field [1] string?
|
||||||
---@field name string display name and name used for plugin config files
|
---@field name string? display name and name used for plugin config files
|
||||||
---@field url string
|
---@field url string?
|
||||||
---@field dir string
|
---@field dir string?
|
||||||
---@field enabled? boolean|(fun():boolean)
|
---@field enabled? boolean|(fun():boolean)
|
||||||
---@field lazy? boolean
|
---@field lazy? boolean
|
||||||
---@field dev? boolean If set, then link to the respective folder under your ~/projects
|
---@field dev? boolean If set, then link to the respective folder under your ~/projects
|
||||||
|
|
Loading…
Reference in New Issue