From 5ceb5733292f51e11670618411ee84d1bca5a3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Chartier?= Date: Wed, 29 Jan 2025 20:30:11 +0100 Subject: [PATCH] fix: resolve cursor line background transparency issue --- README.md | 2 ++ lua/tiny-inline-diagnostic/highlights.lua | 2 +- lua/tiny-inline-diagnostic/presets.lua | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 22bb907..88575af 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ require("tiny-inline-diagnostic").setup({ -- "ghost", "simple", "nonerdfont", "amongus" preset = "modern", + transparent_bg = false, -- Set the background of the diagnostic to transparent + hi = { error = "DiagnosticError", -- Highlight group for error messages warn = "DiagnosticWarn", -- Highlight group for warning messages diff --git a/lua/tiny-inline-diagnostic/highlights.lua b/lua/tiny-inline-diagnostic/highlights.lua index ac84394..e0483c3 100644 --- a/lua/tiny-inline-diagnostic/highlights.lua +++ b/lua/tiny-inline-diagnostic/highlights.lua @@ -84,7 +84,7 @@ local function create_highlight_groups(colors, blends, transparent) for severity, name in pairs(SEVERITY_NAMES) do -- Cursor line highlights hi[HIGHLIGHT_PREFIX .. name .. "CursorLine"] = { - bg = transparent and "None" or colors.background, + bg = colors.background, fg = colors[string.lower(name)].fg, italic = colors[string.lower(name)].italic, } diff --git a/lua/tiny-inline-diagnostic/presets.lua b/lua/tiny-inline-diagnostic/presets.lua index d4b3ead..9202bed 100644 --- a/lua/tiny-inline-diagnostic/presets.lua +++ b/lua/tiny-inline-diagnostic/presets.lua @@ -86,6 +86,7 @@ function M.build(name, transparent_bg) if transparent_bg then preset.signs.left = "" preset.signs.right = "" + preset.blend.factor = 0 end return preset