mirror of https://github.com/folke/lazy.nvim.git
ci: added debug info when #topmods>1
This commit is contained in:
parent
0bc73db503
commit
8063523471
|
@ -101,6 +101,11 @@ function M.disable()
|
||||||
if not M.enabled then
|
if not M.enabled then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
if M.debug and vim.tbl_count(M.topmods) > 1 then
|
||||||
|
vim.schedule(function()
|
||||||
|
vim.notify("topmods:\n" .. vim.inspect(M.topmods), vim.log.levels.WARN, { title = "lazy.nvim" })
|
||||||
|
end)
|
||||||
|
end
|
||||||
-- selene:allow(global_usage)
|
-- selene:allow(global_usage)
|
||||||
_G.loadfile = M._loadfile
|
_G.loadfile = M._loadfile
|
||||||
M.enabled = false
|
M.enabled = false
|
||||||
|
@ -201,18 +206,6 @@ function M.load(modkey, modpath)
|
||||||
return chunk, err
|
return chunk, err
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.require(modname)
|
|
||||||
local chunk = M.loader(modname)
|
|
||||||
if type(chunk) == "string" then
|
|
||||||
error(chunk)
|
|
||||||
end
|
|
||||||
---@diagnostic disable-next-line: no-unknown
|
|
||||||
local mod = chunk()
|
|
||||||
---@diagnostic disable-next-line: no-unknown
|
|
||||||
package.loaded[modname] = mod
|
|
||||||
return mod
|
|
||||||
end
|
|
||||||
|
|
||||||
-- index the top-level lua modules for this path
|
-- index the top-level lua modules for this path
|
||||||
function M._index(path)
|
function M._index(path)
|
||||||
if not M.indexed[path] and path:sub(-6, -1) ~= "/after" then
|
if not M.indexed[path] and path:sub(-6, -1) ~= "/after" then
|
||||||
|
@ -262,7 +255,8 @@ function M.find_dir(modname)
|
||||||
-- in case modname is just a directory and not a real mod,
|
-- in case modname is just a directory and not a real mod,
|
||||||
-- check for any children in the cache
|
-- check for any children in the cache
|
||||||
for child, entry in pairs(M.cache) do
|
for child, entry in pairs(M.cache) do
|
||||||
if child:find(modname, 1, true) == 1 and M.check_path(nil, entry.modpath) then
|
if child:find(modname, 1, true) == 1 then
|
||||||
|
if M.check_path(child, entry.modpath) then
|
||||||
local basename = modname:gsub("%.", "/")
|
local basename = modname:gsub("%.", "/")
|
||||||
local childbase = child:gsub("%.", "/")
|
local childbase = child:gsub("%.", "/")
|
||||||
local ret = entry.modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
|
local ret = entry.modpath:gsub("/init%.lua$", ""):gsub("%.lua$", "")
|
||||||
|
@ -271,6 +265,7 @@ function M.find_dir(modname)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- not found in cache, so find the root with the special pattern
|
-- not found in cache, so find the root with the special pattern
|
||||||
local modpath = M.find(modname, { patterns = { "" } })
|
local modpath = M.find(modname, { patterns = { "" } })
|
||||||
|
|
Loading…
Reference in New Issue