mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 19:34:15 +00:00
feat: LazyKeysBase Support opts and rhs_maker
opts, a table of key options for vim.keymap.set. rhs_maker, a function that returns a rhs. run after plugin loads, it could produce rhs dynamically.
This commit is contained in:
parent
16603c6917
commit
b1213d426f
2 changed files with 24 additions and 3 deletions
|
@ -167,7 +167,8 @@ end
|
|||
---@param plugins string|LazyPlugin|string[]|LazyPlugin[]
|
||||
---@param reason {[string]:string}
|
||||
---@param opts? {force:boolean} when force is true, we skip the cond check
|
||||
function M.load(plugins, reason, opts)
|
||||
---@param afterload? function a function that runs after load
|
||||
function M.load(plugins, reason, opts, afterload)
|
||||
---@diagnostic disable-next-line: cast-local-type
|
||||
plugins = (type(plugins) == "string" or plugins.name) and { plugins } or plugins
|
||||
---@cast plugins (string|LazyPlugin)[]
|
||||
|
@ -185,6 +186,9 @@ function M.load(plugins, reason, opts)
|
|||
end
|
||||
if plugin and not plugin._.loaded then
|
||||
M._load(plugin, reason, opts)
|
||||
if afterload then
|
||||
afterload()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue