mirror of https://github.com/folke/lazy.nvim.git
fix: make sure Plugin.opt is always a boolean
This commit is contained in:
parent
812bb3c8b7
commit
ca78dd77ac
|
@ -212,6 +212,7 @@ function M.update_state(opts)
|
||||||
or plugin.keys
|
or plugin.keys
|
||||||
or plugin.ft
|
or plugin.ft
|
||||||
or plugin.cmd
|
or plugin.cmd
|
||||||
|
plugin.opt = plugin.opt and true or false
|
||||||
end
|
end
|
||||||
local opt = plugin.opt and "opt" or "start"
|
local opt = plugin.opt and "opt" or "start"
|
||||||
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name
|
plugin.dir = Config.options.packpath .. "/" .. opt .. "/" .. plugin.name
|
||||||
|
|
|
@ -30,12 +30,12 @@ end)
|
||||||
|
|
||||||
describe("plugin spec opt", function()
|
describe("plugin spec opt", function()
|
||||||
it("handles dependencies", function()
|
it("handles dependencies", function()
|
||||||
|
Config.options.opt = false
|
||||||
local tests = {
|
local tests = {
|
||||||
{ "foo/bar", dependencies = { "foo/dep1", "foo/dep2" } },
|
{ "foo/bar", dependencies = { "foo/dep1", "foo/dep2" } },
|
||||||
{ "foo/bar", dependencies = { { "foo/dep1" }, "foo/dep2" } },
|
{ "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
|
for _, test in ipairs(tests) do
|
||||||
local spec = Plugin.Spec.new(test)
|
local spec = Plugin.Spec.new(test)
|
||||||
Plugin.update_state({ plugins = spec.plugins })
|
Plugin.update_state({ plugins = spec.plugins })
|
||||||
|
|
Loading…
Reference in New Issue