feat(commands): allow force loading a plugin

This commit is contained in:
Luuk van Baal 2023-01-06 00:28:55 +01:00
commit d6f552c68a
3 changed files with 6 additions and 2 deletions

View file

@ -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