fix: do not print invisible text

This commit is contained in:
Jan De Dobbeleer 2021-09-28 20:19:24 +02:00 committed by Jan De Dobbeleer
parent f860c8cb55
commit 3d4b3c891c

View file

@ -97,7 +97,7 @@ func (a *AnsiColor) getAnsiFromColorString(colorString string, isBackground bool
func (a *AnsiColor) writeColoredText(background, foreground, text string) {
// Avoid emitting empty strings with color codes
if text == "" {
if text == "" || (foreground == Transparent && background == Transparent) {
return
}
// default to white fg if empty, empty backgrond is supported