Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: catch errors setting up rtp when plugin not installed #1193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion lua/lazy/core/loader.lua
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,18 @@ function M.add_to_rtp(plugin)
table.insert(rtp, idx_after or (#rtp + 1), after)
end

vim.opt.rtp = rtp
local ok, result = pcall(function()
vim.opt.rtp = rtp
end)
if not ok then
-- Often gets E5108 when plugins aren't installed, but it's
-- inconsistent.
vim.notify(
"Unable to add rtp for " .. plugin.name .. ". Error message: " .. result,
vim.log.levels.WARN,
{ title = "lazy.nvim" }
)
end
end

function M.source(path)
Expand Down