refactor: do not render empty string

This commit is contained in:
Jan De Dobbeleer 2021-06-08 19:29:09 +02:00 committed by Jan De Dobbeleer
parent b05a4573e7
commit 3bc9448be2

View file

@ -108,6 +108,9 @@ func (a *AnsiColor) writeAndRemoveText(background, foreground, text, textToRemov
}
func (a *AnsiColor) write(background, foreground, text string) {
if len(text) == 0 {
return
}
text = a.ansi.escapeText(text)
text = a.ansi.formatText(text)
text = a.ansi.generateHyperlink(text)