This commit is contained in:
Vlad 2025-03-02 12:17:09 +02:00 committed by GitHub
commit dc7e608d6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 30 additions and 6 deletions

View file

@ -481,4 +481,22 @@ function M._values(root, plugin, prop, is_list)
end
end
-- Collects super values associated with a property that are functions
-- Used for init key
---@param plugin LazyPlugin
---@param prop string
---@return fun(self: LazyPlugin)[]
function M.super_functions(plugin, prop)
if not plugin[prop] then
return {}
end
local super = getmetatable(plugin)
local result = super and M.super_functions(super.__index, prop) or {}
local value = rawget(plugin, prop)
if type(value) == "function" then
table.insert(result, value)
end
return result
end
return M