mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 04:46:45 +00:00
Merge 9f4b3546f6
into 6c3bda4aca
This commit is contained in:
commit
dc7e608d6b
2 changed files with 30 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue