Skip to content

Commit

Permalink
fix(loader): load plugin opts inside a try clause to report errors
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jan 15, 2023
1 parent 9375f68 commit 7160ca4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7160ca4

Please sign in to comment.