Skip to content

Commit

Permalink
refactor: do not render empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
JanDeDobbeleer committed Jun 9, 2021
1 parent b05a457 commit 3bc9448
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ansi_color.go
Expand Up @@ -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)
Expand Down

0 comments on commit 3bc9448

Please sign in to comment.