mirror of https://github.com/folke/lazy.nvim.git
perf: dont loop over handlers to determine if a plugin should be opt=true
This commit is contained in:
parent
ba8b4723a7
commit
812bb3c8b7
|
@ -205,14 +205,13 @@ function M.update_state(opts)
|
||||||
plugin._ = plugin._ or {}
|
plugin._ = plugin._ or {}
|
||||||
plugin[1] = plugin["1"] or plugin[1]
|
plugin[1] = plugin["1"] or plugin[1]
|
||||||
if plugin.opt == nil then
|
if plugin.opt == nil then
|
||||||
local has_handler = false
|
plugin.opt = plugin.dep
|
||||||
for handler, _ in pairs(Handler.handlers) do
|
or Config.options.opt
|
||||||
if plugin[handler] then
|
or plugin.module
|
||||||
has_handler = true
|
or plugin.event
|
||||||
break
|
or plugin.keys
|
||||||
end
|
or plugin.ft
|
||||||
end
|
or plugin.cmd
|
||||||
plugin.opt = plugin.dep or has_handler or Config.options.opt
|
|
||||||
end
|
end
|
||||||
local opt = plugin.opt and "opt" or "start"
|
local opt = plugin.opt and "opt" or "start"
|
||||||
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name
|
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name
|
||||||
|
|
Loading…
Reference in New Issue