diff --git a/doc/cp.nvim.txt b/doc/cp.nvim.txt index f99b07b..570beb5 100644 --- a/doc/cp.nvim.txt +++ b/doc/cp.nvim.txt @@ -784,12 +784,15 @@ HIGHLIGHT GROUPS *cp-highlights* Test Status Groups ~ - CpTestAC Green foreground for AC status - CpTestWA Red foreground for WA status - CpTestTLE Orange foreground for TLE status - CpTestMLE Orange foreground for MLE status - CpTestRTE Purple foreground for RTE status - CpTestNA Gray foreground for remaining state +All test status groups link to builtin highlight groups, automatically adapting +to your colorscheme: + + CpTestAC Links to DiagnosticOk (AC status) + CpTestWA Links to DiagnosticError (WA status) + CpTestTLE Links to DiagnosticWarn (TLE status) + CpTestMLE Links to DiagnosticWarn (MLE status) + CpTestRTE Links to DiagnosticHint (RTE status) + CpTestNA Links to Comment (pending/unknown status) ANSI Color Groups ~ diff --git a/lua/cp/runner/run_render.lua b/lua/cp/runner/run_render.lua index 1b81797..2dfb45b 100644 --- a/lua/cp/runner/run_render.lua +++ b/lua/cp/runner/run_render.lua @@ -367,14 +367,12 @@ end ---@return table function M.get_highlight_groups() return { - CpTestAC = { fg = '#10b981' }, - CpTestWA = { fg = '#ef4444' }, - CpTestTLE = { fg = '#f59e0b' }, - CpTestMLE = { fg = '#f59e0b' }, - CpTestRTE = { fg = '#8b5cf6' }, - CpTestNA = { fg = '#6b7280' }, - CpDiffRemoved = { fg = '#ef4444', bg = '#1f1f1f' }, - CpDiffAdded = { fg = '#10b981', bg = '#1f1f1f' }, + CpTestAC = { link = 'DiagnosticOk' }, + CpTestWA = { link = 'DiagnosticError' }, + CpTestTLE = { link = 'DiagnosticWarn' }, + CpTestMLE = { link = 'DiagnosticWarn' }, + CpTestRTE = { link = 'DiagnosticHint' }, + CpTestNA = { link = 'Comment' }, } end diff --git a/lua/cp/ui/highlight.lua b/lua/cp/ui/highlight.lua index 02bf1ae..a0dd17d 100644 --- a/lua/cp/ui/highlight.lua +++ b/lua/cp/ui/highlight.lua @@ -26,7 +26,7 @@ local function parse_diff_line(text) line = 0, col_start = highlight_start, col_end = #result_text, - highlight_group = 'CpDiffRemoved', + highlight_group = 'DiffDelete', }) pos = removed_end + 1 else @@ -38,7 +38,7 @@ local function parse_diff_line(text) line = 0, col_start = highlight_start, col_end = #result_text, - highlight_group = 'CpDiffAdded', + highlight_group = 'DiffAdd', }) pos = added_end + 1 else