From bd89c050685361ee13685a5a0c6d84c2f2fc2ca5 Mon Sep 17 00:00:00 2001 From: ray Date: Thu, 11 Dec 2025 23:56:10 +0000 Subject: [PATCH] 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. --- lua/autocmds.lua | 22 ++++++++++++++++++++++ lua/paper-tonic-modern/groups/editor.lua | 10 +++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lua/autocmds.lua b/lua/autocmds.lua index 412149f..22a7129 100644 --- a/lua/autocmds.lua +++ b/lua/autocmds.lua @@ -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', '\\', 10) + vim.fn.matchadd('qfWarning', '\\', 10) + vim.fn.matchadd('qfInfo', '\\', 10) + vim.fn.matchadd('qfHint', '\\', 10) + vim.fn.matchadd('qfNote', '\\', 10) + + -- Also match uppercase variants + vim.fn.matchadd('qfError', '\\', 10) + vim.fn.matchadd('qfWarning', '\\', 10) + vim.fn.matchadd('qfInfo', '\\', 10) + vim.fn.matchadd('qfHint', '\\', 10) + vim.fn.matchadd('qfNote', '\\', 10) + end, +}) + return {} diff --git a/lua/paper-tonic-modern/groups/editor.lua b/lua/paper-tonic-modern/groups/editor.lua index 9ffb844..4f8c817 100644 --- a/lua/paper-tonic-modern/groups/editor.lua +++ b/lua/paper-tonic-modern/groups/editor.lua @@ -118,11 +118,19 @@ return { Conceal = 'Noise', -- ============================================================================ - -- QuickFix + -- QuickFix & Location List -- ============================================================================ QuickFixLine = { bg = c.bg_hl_special_weak, bold = true }, + -- Diagnostic severity highlighting in quickfix/location list + -- These are custom syntax groups defined in autocmds.lua + qfError = { fg = c.diag_error, bold = true }, -- "error:" or "[E]" + qfWarning = { fg = c.diag_warn, bold = true }, -- "warning:" or "[W]" + qfInfo = { fg = c.diag_info, bold = true }, -- "info:" or "[I]" + qfHint = { fg = c.diag_hint, bold = true }, -- "hint:" or "[H]" + qfNote = { fg = c.diag_hint, bold = true }, -- "note:" (same as hint) + -- ============================================================================ -- Debug -- ============================================================================