Skip to content

Commit ca78dd7

Browse files
committed
fix: make sure Plugin.opt is always a boolean
1 parent 812bb3c commit ca78dd7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lua/lazy/core/plugin.lua

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ function M.update_state(opts)
212212
or plugin.keys
213213
or plugin.ft
214214
or plugin.cmd
215+
plugin.opt = plugin.opt and true or false
215216
end
216217
local opt = plugin.opt and "opt" or "start"
217218
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name

tests/core/plugin_spec.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ end)
3030

3131
describe("plugin spec opt", function()
3232
it("handles dependencies", function()
33+
Config.options.opt = false
3334
local tests = {
3435
{ "foo/bar", dependencies = { "foo/dep1", "foo/dep2" } },
3536
{ "foo/bar", dependencies = { { "foo/dep1" }, "foo/dep2" } },
3637
{ { { "foo/bar", dependencies = { { "foo/dep1" }, "foo/dep2" } } } },
3738
}
38-
Config.options.opt = false
3939
for _, test in ipairs(tests) do
4040
local spec = Plugin.Spec.new(test)
4141
Plugin.update_state({ plugins = spec.plugins })

0 commit comments

Comments
 (0)