diff options
Diffstat (limited to 'internal/color')
| -rw-r--r-- | internal/color/brush/brush.go | 14 | ||||
| -rw-r--r-- | internal/color/paint.go | 5 |
2 files changed, 5 insertions, 14 deletions
diff --git a/internal/color/brush/brush.go b/internal/color/brush/brush.go index 785a0d0..524829b 100644 --- a/internal/color/brush/brush.go +++ b/internal/color/brush/brush.go @@ -183,19 +183,6 @@ func Colorfy(line string) string { case strings.HasPrefix(line, "SERVER"): paintServer(&sb, line) - /* - case strings.Contains(line, "ERROR"): - color.PaintWithAttr(&sb, line, - config.Client.TermColors.ClientErrorFg, - config.Client.TermColors.ClientErrorBg, - config.Client.TermColors.ClientErrorAttr) - - case strings.Contains(line, "WARN"): - color.PaintWithAttr(&sb, line, - config.Client.TermColors.ClientWarnFg, - config.Client.TermColors.ClientWarnBg, - config.Client.TermColors.ClientWarnAttr) - */ default: color.PaintWithAttr(&sb, line, color.FgDefault, @@ -203,6 +190,5 @@ func Colorfy(line string) string { color.AttrNone) } - color.ResetWithAttr(&sb) return sb.String() } diff --git a/internal/color/paint.go b/internal/color/paint.go index 2798ff7..5430acd 100644 --- a/internal/color/paint.go +++ b/internal/color/paint.go @@ -38,6 +38,8 @@ func Paint(sb *strings.Builder, text string, fg FgColor, bg BgColor) { sb.WriteString(string(fg)) sb.WriteString(string(bg)) sb.WriteString(text) + sb.WriteString(string(BgDefault)) + sb.WriteString(string(FgDefault)) } // Reset background and foreground colors. @@ -56,6 +58,9 @@ func PaintWithAttr(sb *strings.Builder, text string, fg FgColor, bg BgColor, att sb.WriteString(string(bg)) sb.WriteString(string(attr)) sb.WriteString(text) + sb.WriteString(string(AttrReset)) + sb.WriteString(string(BgDefault)) + sb.WriteString(string(FgDefault)) } // ResetWithAttr resets background, foreground and attributes. |
