mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-04-18 20:36:45 +00:00
fix(spec): Plugin.opts
is now always a table. Fixes #351
This commit is contained in:
parent
ef87c24e8e
commit
e77be3cf3b
3 changed files with 13 additions and 5 deletions
|
@ -234,6 +234,7 @@ end
|
|||
-- Merges super opts or runs the opts function to override opts or return new ones
|
||||
---@param plugin LazyPlugin
|
||||
function M.opts(plugin)
|
||||
---@type table
|
||||
local opts = plugin._.super and M.opts(plugin._.super) or {}
|
||||
---@type PluginOpts?
|
||||
local plugin_opts = rawget(plugin, "opts")
|
||||
|
@ -273,11 +274,7 @@ function M.config(plugin)
|
|||
end
|
||||
if #mods == 1 then
|
||||
fn = function()
|
||||
local opts = M.opts(plugin)
|
||||
if next(opts) == nil then
|
||||
opts = nil
|
||||
end
|
||||
require(mods[1]).setup(opts)
|
||||
require(mods[1]).setup(M.opts(plugin))
|
||||
end
|
||||
else
|
||||
return Util.error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue