Skip to content

Commit

Permalink
fix: make sure Plugin.opt is always a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Nov 29, 2022
1 parent 812bb3c commit ca78dd7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/lazy/core/plugin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ function M.update_state(opts)
or plugin.keys
or plugin.ft
or plugin.cmd
plugin.opt = plugin.opt and true or false
end
local opt = plugin.opt and "opt" or "start"
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name
Expand Down
2 changes: 1 addition & 1 deletion tests/core/plugin_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ end)

describe("plugin spec opt", function()
it("handles dependencies", function()
Config.options.opt = false
local tests = {
{ "foo/bar", dependencies = { "foo/dep1", "foo/dep2" } },
{ "foo/bar", dependencies = { { "foo/dep1" }, "foo/dep2" } },
{ { { "foo/bar", dependencies = { { "foo/dep1" }, "foo/dep2" } } } },
}
Config.options.opt = false
for _, test in ipairs(tests) do
local spec = Plugin.Spec.new(test)
Plugin.update_state({ plugins = spec.plugins })
Expand Down

0 comments on commit ca78dd7

Please sign in to comment.