From e94c3cb923654bdcb194368e12e258b0a27aed2e Mon Sep 17 00:00:00 2001 From: ray Date: Mon, 8 Dec 2025 00:10:32 +0000 Subject: [PATCH] update diagnostic signs configuration Refactor the diagnostic signs setup to use a structured table for severity levels, improving clarity and maintainability. --- lua/settings.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lua/settings.lua b/lua/settings.lua index 9f30fde..940d399 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -52,7 +52,14 @@ vim.diagnostic.config({ return string.format("%s: %s", diagnostic.source or "", diagnostic.message) end, }, - signs = true, -- Keep signs in signcolumn + signs = { + text = { + [vim.diagnostic.severity.ERROR] = "E", + [vim.diagnostic.severity.WARN] = "W", + [vim.diagnostic.severity.HINT] = "H", + [vim.diagnostic.severity.INFO] = "I", + }, + }, underline = true, -- Underline problematic text update_in_insert = false, -- Don't update diagnostics while typing severity_sort = true, -- Sort by severity (errors first) @@ -63,10 +70,3 @@ vim.diagnostic.config({ prefix = '', }, }) - --- Diagnostic signs in signcolumn -local signs = { Error = "E", Warn = "W", Hint = "H", Info = "I" } -for type, icon in pairs(signs) do - local hl = "DiagnosticSign" .. type - vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) -end