From 7160ca419e7be36536dd8fe90ad0bf26cdd773ae Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 15 Jan 2023 20:00:07 +0100 Subject: [PATCH] fix(loader): load plugin opts inside a `try` clause to report errors --- lua/lazy/core/loader.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/lazy/core/loader.lua b/lua/lazy/core/loader.lua index e5f727a7..68f05e82 100644 --- a/lua/lazy/core/loader.lua +++ b/lua/lazy/core/loader.lua @@ -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