mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
feat: lazy setup with either a plugins module, or a plugins spec
This commit is contained in:
parent
f0894be69d
commit
af8b8e128e
8 changed files with 54 additions and 53 deletions
|
@ -193,25 +193,14 @@ function M:reason(reason, opts)
|
|||
---@type string?
|
||||
local source = reason.source
|
||||
if source then
|
||||
---@type string?
|
||||
local modname = source:match("/lua/(.*)%.lua$")
|
||||
if modname then
|
||||
modname = modname:gsub("/", ".")
|
||||
end
|
||||
local name = source:match("/([^/]-)/lua")
|
||||
for _, other in pairs(Config.plugins) do
|
||||
if (modname and other.modname == modname) or (name and other.name == name) then
|
||||
if name and other.name == name then
|
||||
reason.plugin = other.name
|
||||
reason.source = nil
|
||||
break
|
||||
end
|
||||
end
|
||||
if reason.source then
|
||||
reason.source = modname or reason.source
|
||||
if reason.source == "lua" then
|
||||
reason.source = Config.options.plugins
|
||||
end
|
||||
end
|
||||
end
|
||||
local time = " " .. math.floor((reason.time or 0) / 1e6 * 100) / 100 .. "ms"
|
||||
if not opts.time_right then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue