mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-29 03:44:14 +00:00
feat(commands): allow force loading a plugin
This commit is contained in:
parent
457f0bb7ce
commit
d6f552c68a
3 changed files with 6 additions and 2 deletions
|
@ -187,7 +187,8 @@ function M._load(plugin, reason)
|
|||
end
|
||||
|
||||
if plugin.cond ~= nil then
|
||||
if plugin.cond == false or (type(plugin.cond) == "function" and not plugin.cond()) then
|
||||
local force = reason.cmd and reason.cmd:sub(-1) == "!"
|
||||
if not force and (plugin.cond == false or (type(plugin.cond) == "function" and not plugin.cond())) then
|
||||
plugin._.cond = false
|
||||
return
|
||||
end
|
||||
|
|
|
@ -52,6 +52,9 @@ M.commands = {
|
|||
load = function(opts)
|
||||
require("lazy.core.loader").load(opts.plugins, { cmd = "LazyLoad" })
|
||||
end,
|
||||
["load!"] = function(opts)
|
||||
require("lazy.core.loader").load(opts.plugins, { cmd = "LazyLoad!" })
|
||||
end,
|
||||
log = Manage.log,
|
||||
build = Manage.build,
|
||||
clean = Manage.clean,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue