From 111266d83246cffa0f70d1db054f1e39a555ff80 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 27 Jun 2025 23:21:48 +0900 Subject: [PATCH] Reset full-background property after a new line --- src/ansi.go | 2 ++ src/core.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/ansi.go b/src/ansi.go index 1311620d..6bff3d2b 100644 --- a/src/ansi.go +++ b/src/ansi.go @@ -287,6 +287,8 @@ func extractColor(str string, state *ansiState, proc func(string, *ansiState) bo [2]int32{int32(runeCount), int32(runeCount)}, marker, }) + // Reset the full-line background color + newState.lbg = -1 } } diff --git a/src/core.go b/src/core.go index ac42143d..da7da137 100644 --- a/src/core.go +++ b/src/core.go @@ -88,6 +88,9 @@ func Run(opts *Options) (int, error) { marker.color.attr = marker.color.attr | tui.FullBg newOffsets := append(*offsets, marker) offsets = &newOffsets + + // Reset the full-line background color + lineAnsiState.lbg = -1 } return util.ToChars(stringBytes(trimmed)), offsets }