Unified Agent + reusable Go agent core.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(clifmt): fix operation order in diff background stripping

The previous fix stripped Chroma background colors, but it did so
AFTER replacing \\x1b[0m with diff bg+fg. This caused ansiBgRe to
also strip the diff background colors we had just inserted, leaving
gaps (black blocks) between syntax-highlighted tokens.

Fix the order: first strip all Chroma background colors, THEN replace
\\x1b[0m with our own diff background+foreground. This ensures the
diff's red/green background remains throughout the entire line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

authored by

Teteuya
Claude Sonnet 4.6
and committed by
Lyric Wai
bcc10b25 7301fffd

+4 -4
+4 -4
internal/clifmt/diff.go
··· 299 299 fg := "\x1b[38;5;174m" 300 300 b.WriteString(bg) 301 301 b.WriteString(fmt.Sprintf("%s%*d%s - ", gray, gutterWidth, lineNum, fg)) 302 - safeText := strings.ReplaceAll(text, "\x1b[0m", "\x1b[39m"+bg+fg) 303 - safeText = ansiBgRe.ReplaceAllString(safeText, "") 302 + safeText := ansiBgRe.ReplaceAllString(text, "") 303 + safeText = strings.ReplaceAll(safeText, "\x1b[0m", "\x1b[39m"+bg+fg) 304 304 b.WriteString(safeText) 305 305 b.WriteString(bg) 306 306 b.WriteString("\x1b[K\x1b[0m") ··· 313 313 fg := "\x1b[38;5;108m" 314 314 b.WriteString(bg) 315 315 b.WriteString(fmt.Sprintf("%s%*d%s + ", gray, gutterWidth, lineNum, fg)) 316 - safeText := strings.ReplaceAll(text, "\x1b[0m", "\x1b[39m"+bg+fg) 317 - safeText = ansiBgRe.ReplaceAllString(safeText, "") 316 + safeText := ansiBgRe.ReplaceAllString(text, "") 317 + safeText = strings.ReplaceAll(safeText, "\x1b[0m", "\x1b[39m"+bg+fg) 318 318 b.WriteString(safeText) 319 319 b.WriteString(bg) 320 320 b.WriteString("\x1b[K\x1b[0m")