mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-19 04:46:45 +00:00
parent
2f5c1be525
commit
aed842ae1e
5 changed files with 12 additions and 1 deletions
|
@ -121,6 +121,11 @@ function M.load(plugins, reason)
|
|||
end
|
||||
end
|
||||
|
||||
if try_load and plugin.cond then
|
||||
try_load = plugin.cond == true or (type(plugin.cond) == "function" and plugin.cond()) or false
|
||||
plugin._.cond = try_load
|
||||
end
|
||||
|
||||
---@cast plugin LazyPlugin
|
||||
|
||||
if try_load and not plugin._.loaded then
|
||||
|
|
|
@ -18,6 +18,7 @@ local M = {}
|
|||
---@field cloned? boolean
|
||||
---@field kind? LazyPluginKind
|
||||
---@field dep? boolean True if this plugin is only in the spec as a dependency
|
||||
---@field cond? boolean
|
||||
|
||||
---@class LazyPluginHooks
|
||||
---@field init? fun(LazyPlugin) Will always be run
|
||||
|
@ -44,6 +45,7 @@ local M = {}
|
|||
---@field url string?
|
||||
---@field dir string
|
||||
---@field enabled? boolean|(fun():boolean)
|
||||
---@field cond? boolean|(fun():boolean)
|
||||
---@field lazy? boolean
|
||||
---@field dev? boolean If set, then link to the respective folder under your ~/projects
|
||||
---@field dependencies? string[]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue