When a spec had an `import` property, the `cond` property was treated
the same as `enabled`; any specs to be imported were ignored and treated
as uninstalled if `cond` evaluated to false. This is inconsistent with
how `cond` behaves in a plugin spec without an `import` property.
To make the behavior consistent when using `import` to manage submodules
of plugin specs, merge the `cond` property of the "parent" spec(s)
containing an `import` property with any `cond` property found on the
imported "child" spec(s), including nested `import` specs. The parent
and child `cond` properties are evaluated and combined with boolean
`and`.
Signed-off-by: Ross Williams <ross@ross-williams.net>
In some case, `dev.path .. plugin.name` is not enoguh.
For example, when using `ghq` to manage projects, plugin directories may
vary by onewrs of the plugins.
With this change, users can do something like below
``` lua
require("lazy").setup("plugins", {
dev = {
path = function(p)
-- ghq
local path, cnt = string.gsub(p.url, "^https://(.*)%.git$", "~/ghq/%1")
if cnt == 1 then
return path
end
-- fallback to default
return "~/projects/" .. plugin.name
end,
},
})
```
* feat(plugin): dont include plugin spec fragments for disabled or optional plugins
* test: fixed tests
* fix(plugin): calculate handlers after disabling plugins
* fix(plugin): clear Plugin._.super when rebuilding
* fix(ui): dont process handlers for disabled plugins
* test: added tests for disabling fragments
* fix(plugin): ignore any installed deps of a disabled conditional plugin. Fixes#1053
* deps_of_all_optional: First, refactor the code responsible for disabling unneeded deps to be more generic
* deps_of_all_optional: Second, also disable unneeded deps from plugins marked as all optional
* deps_of_all_optional: add tests proving unneeded optional deps are now also discarded
* deps_of_all_optional: forgot return type
---------
Co-authored-by: abeldekat <abel@nomail.com>