Add diagnostic severity highlighting for quickfix lists
Enhance visibility of diagnostic messages in quickfix and location lists by adding custom syntax groups for error, warning, info, hint, and note.
This commit is contained in:
parent
f2a94d10ac
commit
bd89c05068
2 changed files with 31 additions and 1 deletions
|
|
@ -76,5 +76,27 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Phase 11.8: Colorize diagnostic severity in quickfix/location list
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = aug,
|
||||
pattern = "qf", -- Applies to both quickfix and location list
|
||||
callback = function()
|
||||
-- Use matchadd() for higher priority highlighting
|
||||
-- This will override the default qf syntax
|
||||
vim.fn.matchadd('qfError', '\\<error\\>', 10)
|
||||
vim.fn.matchadd('qfWarning', '\\<warning\\>', 10)
|
||||
vim.fn.matchadd('qfInfo', '\\<info\\>', 10)
|
||||
vim.fn.matchadd('qfHint', '\\<hint\\>', 10)
|
||||
vim.fn.matchadd('qfNote', '\\<note\\>', 10)
|
||||
|
||||
-- Also match uppercase variants
|
||||
vim.fn.matchadd('qfError', '\\<Error\\>', 10)
|
||||
vim.fn.matchadd('qfWarning', '\\<Warning\\>', 10)
|
||||
vim.fn.matchadd('qfInfo', '\\<Info\\>', 10)
|
||||
vim.fn.matchadd('qfHint', '\\<Hint\\>', 10)
|
||||
vim.fn.matchadd('qfNote', '\\<Note\\>', 10)
|
||||
end,
|
||||
})
|
||||
|
||||
return {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue