From 6b14a6bf90b1dd73a270b36ff8ad7db1b4084aa9 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 24 Feb 2026 19:48:13 -0500 Subject: [PATCH] fix(buffer): link highlight groups to colorscheme via default = true Problem: highlight groups used hardcoded hex colours and a bespoke hlexists guard, ignoring the user's colorscheme and preventing overrides from working naturally. Solution: replace the guard wrapper with direct nvim_set_hl calls using default = true and link, so each group falls back to a semantically appropriate built-in group (Title, DiagnosticHint, DiagnosticError, Comment, DiagnosticWarn) unless the user has already defined them. --- lua/pending/buffer.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lua/pending/buffer.lua b/lua/pending/buffer.lua index e36972e..bf598fc 100644 --- a/lua/pending/buffer.lua +++ b/lua/pending/buffer.lua @@ -145,16 +145,11 @@ local function apply_extmarks(bufnr, line_meta) end local function setup_highlights() - local function hl(name, opts) - if vim.fn.hlexists(name) == 0 or vim.tbl_isempty(vim.api.nvim_get_hl(0, { name = name })) then - vim.api.nvim_set_hl(0, name, opts) - end - end - hl('PendingHeader', { bold = true }) - hl('PendingDue', { fg = '#888888', italic = true }) - hl('PendingOverdue', { fg = '#e06c75', italic = true }) - hl('PendingDone', { strikethrough = true, fg = '#666666' }) - hl('PendingPriority', { fg = '#e06c75', bold = true }) + vim.api.nvim_set_hl(0, 'PendingHeader', { link = 'Title', default = true }) + vim.api.nvim_set_hl(0, 'PendingDue', { link = 'DiagnosticHint', default = true }) + vim.api.nvim_set_hl(0, 'PendingOverdue', { link = 'DiagnosticError', default = true }) + vim.api.nvim_set_hl(0, 'PendingDone', { link = 'Comment', default = true }) + vim.api.nvim_set_hl(0, 'PendingPriority', { link = 'DiagnosticWarn', default = true }) end ---@param bufnr? integer