mirror of https://github.com/folke/lazy.nvim.git
fix(loader): load plugin opts inside a `try` clause to report errors
This commit is contained in:
parent
9375f68dcd
commit
7160ca419e
|
@ -234,10 +234,10 @@ end
|
||||||
--- runs plugin config
|
--- runs plugin config
|
||||||
---@param plugin LazyPlugin
|
---@param plugin LazyPlugin
|
||||||
function M.config(plugin)
|
function M.config(plugin)
|
||||||
local opts = Plugin.values(plugin, "opts", false)
|
|
||||||
local fn
|
local fn
|
||||||
if type(plugin.config) == "function" then
|
if type(plugin.config) == "function" then
|
||||||
fn = function()
|
fn = function()
|
||||||
|
local opts = Plugin.values(plugin, "opts", false)
|
||||||
plugin.config(plugin, opts)
|
plugin.config(plugin, opts)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -255,6 +255,7 @@ function M.config(plugin)
|
||||||
end
|
end
|
||||||
if #mods == 1 then
|
if #mods == 1 then
|
||||||
fn = function()
|
fn = function()
|
||||||
|
local opts = Plugin.values(plugin, "opts", false)
|
||||||
require(mods[1]).setup(opts)
|
require(mods[1]).setup(opts)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue