fix(rocks): better errors / warnings when something goes wrong with luarocks

This commit is contained in:
Folke Lemaitre 2024-06-25 13:23:25 +02:00
parent 9005e8ede7
commit 7d3f69104f
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
11 changed files with 336 additions and 141 deletions

View file

@ -31,18 +31,20 @@ M.colors = {
ButtonActive = "Visual",
TaskOutput = "MsgArea", -- task output
TaskError = "ErrorMsg", -- task errors
TaskWarning = "WarningMsg", -- task errors
Dir = "@markup.link", -- directory
Url = "@markup.link", -- url
Bold = { bold = true },
Italic = { italic = true },
}
M.did_setup = false
function M.set_hl()
for hl_group, link in pairs(M.colors) do
vim.api.nvim_set_hl(0, "Lazy" .. hl_group, {
link = link,
default = true,
})
local hl = type(link) == "table" and link or { link = link }
hl.default = true
vim.api.nvim_set_hl(0, "Lazy" .. hl_group, hl)
end
end
@ -54,6 +56,11 @@ function M.setup()
M.did_setup = true
M.set_hl()
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
M.set_hl()
end,
})
vim.api.nvim_create_autocmd("ColorScheme", {
callback = function()
M.set_hl()