Fix panic when color is disabled and header lines contain ANSI colors
Close #732
This commit is contained in:
parent
a221c672fb
commit
7ce427ff47
@ -147,6 +147,8 @@ func (result *Result) colorOffsets(matchOffsets []Offset, theme *tui.ColorTheme,
|
|||||||
} else {
|
} else {
|
||||||
ansi := itemColors[curr-1]
|
ansi := itemColors[curr-1]
|
||||||
fg := ansi.color.fg
|
fg := ansi.color.fg
|
||||||
|
bg := ansi.color.bg
|
||||||
|
if theme != nil {
|
||||||
if fg == -1 {
|
if fg == -1 {
|
||||||
if current {
|
if current {
|
||||||
fg = theme.Current
|
fg = theme.Current
|
||||||
@ -154,7 +156,6 @@ func (result *Result) colorOffsets(matchOffsets []Offset, theme *tui.ColorTheme,
|
|||||||
fg = theme.Fg
|
fg = theme.Fg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bg := ansi.color.bg
|
|
||||||
if bg == -1 {
|
if bg == -1 {
|
||||||
if current {
|
if current {
|
||||||
bg = theme.DarkBg
|
bg = theme.DarkBg
|
||||||
@ -162,6 +163,7 @@ func (result *Result) colorOffsets(matchOffsets []Offset, theme *tui.ColorTheme,
|
|||||||
bg = theme.Bg
|
bg = theme.Bg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
colors = append(colors, colorOffset{
|
colors = append(colors, colorOffset{
|
||||||
offset: [2]int32{int32(start), int32(idx)},
|
offset: [2]int32{int32(start), int32(idx)},
|
||||||
color: tui.PairFor(fg, bg),
|
color: tui.PairFor(fg, bg),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user