feat(loader): added error handler to sourcing of runtime files

This commit is contained in:
Folke Lemaitre 2022-12-17 12:59:31 +01:00
parent 53affcaaf4
commit eeb06a5a50
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 3 additions and 1 deletions

View File

@ -171,7 +171,9 @@ function M.source_runtime(...)
name = name:sub(1, -5)
if t == "file" and (ext == "lua" or ext == "vim") and not M.disabled_rtp_plugins[name] then
Util.track({ runtime = path })
vim.cmd("silent source " .. path)
Util.try(function()
vim.cmd("silent source " .. path)
end, "Failed to source `" .. path .. "`")
Util.track()
end
end)