Skip to content
Myr

Fix ANSI attributes lost when 'regular' attribute is set to fg or nth

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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

authored by Junegunn Choi · committed by Junegunn Choi · parent 1ecfa38 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:src/tui/dummy.go+2 added-2 removed
11 unmodified lines
1213func (a Attr) Merge(b Attr) Attr {14 if b&AttrRegular > 0 {15 // Only keep bold attribute set by the system16 return b | (a & BoldForce)16 return (b &^ AttrRegular) | (a & BoldForce)17 }1819 return a | b19 return (a &^ AttrRegular) | b20}2122const (23 AttrUndefined = Attr(0)
40 unmodified lines