Skip to content

Commit 4b64680

Browse files
authored
fix: don't propagate startup plugin loading errors (#137)
1 parent 7be25da commit 4b64680

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/lz/n/loader.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,13 @@ function M.load_startup_plugins(plugins)
7171
run_before_all(plugins)
7272
---@param plugin lz.n.Plugin
7373
vim.iter(get_eager_plugins(plugins)):each(function(plugin)
74-
M.load(plugin)
74+
xpcall(
75+
M.load,
76+
vim.schedule_wrap(function(err)
77+
vim.notify("Failed to load " .. plugin.name .. ": " .. tostring(err or ""), vim.log.levels.ERROR)
78+
end),
79+
plugin
80+
)
7581
plugins[plugin.name] = nil
7682
end)
7783
end

0 commit comments

Comments
 (0)