From a9d1d424364ecbdbdb204fc1ffb2463b44bf1e6c Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Fri, 30 May 2025 20:42:55 +0900 Subject: [PATCH] Fix ANSI attributes lost when 'regular' attribute is set to fg or nth Examples: echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color fg:regular echo -e "\x1b[33;3mfoo \x1b[mbar" | fzf --ansi --color nth:regular --- src/tui/dummy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tui/dummy.go b/src/tui/dummy.go index cd856233..47c7d1e2 100644 --- a/src/tui/dummy.go +++ b/src/tui/dummy.go @@ -13,10 +13,10 @@ var DefaultBorderShape = BorderRounded func (a Attr) Merge(b Attr) Attr { if b&AttrRegular > 0 { // Only keep bold attribute set by the system - return b | (a & BoldForce) + return (b &^ AttrRegular) | (a & BoldForce) } - return a | b + return (a &^ AttrRegular) | b } const (