Skip to content
Myr

Fix panic when color is disabled and header lines contain ANSI colors

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

Close #732

authored by Junegunn Choi · committed by Junegunn Choi · parent a221c67 · Browse files · 1 file+14 added−12 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+14 added−12 removed

  • other:+14 added−12 removed

1 file+14 added−12 removed

modified:src/result.go+14 added-12 removed
145 unmodified lines
146 offset: [2]int32{int32(start), int32(idx)}, color: color, attr: attr})147 } else {148 ansi := itemColors[curr-1]149 fg := ansi.color.fg150 if fg == -1 {151 if current {152 fg = theme.Current153 } else {154 fg = theme.Fg155 }156 }150 bg := ansi.color.bg158 if bg == -1 {159 if current {160 bg = theme.DarkBg161 } else {162 bg = theme.Bg151 if theme != nil {152 if fg == -1 {153 if current {154 fg = theme.Current155 } else {156 fg = theme.Fg157 }158 }159 if bg == -1 {160 if current {161 bg = theme.DarkBg162 } else {163 bg = theme.Bg164 }165 }166 }167 colors = append(colors, colorOffset{168 offset: [2]int32{int32(start), int32(idx)},169 color: tui.PairFor(fg, bg),
74 unmodified lines