m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Change how hl:-1 or hl+:-1 is applied to text with background color

This commit is contained in:
Junegunn Choi
2020-12-04 19:27:43 +09:00
parent 052d17e66a
commit d2af3ff98d
2 changed files with 22 additions and 1 deletions

View File

@@ -124,6 +124,10 @@ const (
type Color int32
func (c Color) IsDefault() bool {
return c == colDefault
}
func (c Color) is24() bool {
return c > 0 && (c&(1<<24)) > 0
}
@@ -190,6 +194,11 @@ func (p ColorPair) Attr() Attr {
return p.attr
}
func (p ColorPair) HasBg() bool {
return p.attr&Reverse == 0 && p.bg != colDefault ||
p.attr&Reverse > 0 && p.fg != colDefault
}
func (p ColorPair) merge(other ColorPair, except Color) ColorPair {
dup := p
dup.attr = dup.attr.Merge(other.attr)