mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
refactor(handlers): lazy resolving of plugin handlers (#1126)
* refactor(handlers): lazy resolving of plugin handlers * test: fixed tests
This commit is contained in:
parent
b9c604e839
commit
2f169e74d4
9 changed files with 126 additions and 120 deletions
|
@ -37,7 +37,7 @@ M.group = vim.api.nvim_create_augroup("lazy_handler_event", { clear = true })
|
|||
|
||||
---@param spec LazyEventSpec
|
||||
---@return LazyEvent
|
||||
function M:parse(spec)
|
||||
function M:_parse(spec)
|
||||
local ret = M.mappings[spec] --[[@as LazyEvent?]]
|
||||
if ret then
|
||||
return ret
|
||||
|
@ -62,19 +62,6 @@ function M:parse(spec)
|
|||
return ret
|
||||
end
|
||||
|
||||
---@param plugin LazyPlugin
|
||||
function M:values(plugin)
|
||||
local Plugin = require("lazy.core.plugin")
|
||||
---@type table<string,any>
|
||||
local values = {}
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
for _, value in ipairs(Plugin.values(plugin, self.type, true)) do
|
||||
local event = self:parse(value)
|
||||
values[event.id] = event
|
||||
end
|
||||
return values
|
||||
end
|
||||
|
||||
---@param event LazyEvent
|
||||
function M:_add(event)
|
||||
local done = false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue