fix(loader): load plugin opts inside a `try` clause to report errors

This commit is contained in:
Folke Lemaitre 2023-01-15 20:00:07 +01:00
parent 9375f68dcd
commit 7160ca419e
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 1 deletions

View File

@ -234,10 +234,10 @@ end
--- runs plugin config
---@param plugin LazyPlugin
function M.config(plugin)
local opts = Plugin.values(plugin, "opts", false)
local fn
if type(plugin.config) == "function" then
fn = function()
local opts = Plugin.values(plugin, "opts", false)
plugin.config(plugin, opts)
end
else
@ -255,6 +255,7 @@ function M.config(plugin)
end
if #mods == 1 then
fn = function()
local opts = Plugin.values(plugin, "opts", false)
require(mods[1]).setup(opts)
end
else