From 8cd8c9a7be59a7929f9570ce989391d3e662bf73 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Wed, 28 Dec 2022 17:08:36 +0100 Subject: [PATCH] feat(color): do not clear parent colors --- src/color/plain_writer.go | 1 - src/color/writer.go | 5 ----- src/engine/block.go | 1 - 3 files changed, 7 deletions(-) diff --git a/src/color/plain_writer.go b/src/color/plain_writer.go index e6090f14..0f57c649 100644 --- a/src/color/plain_writer.go +++ b/src/color/plain_writer.go @@ -15,7 +15,6 @@ type PlainWriter struct { func (a *PlainWriter) SetColors(background, foreground string) {} func (a *PlainWriter) SetParentColors(background, foreground string) {} -func (a *PlainWriter) ClearParentColors() {} func (a *PlainWriter) Write(background, foreground, text string) { if len(text) == 0 { diff --git a/src/color/writer.go b/src/color/writer.go index 92428699..22158890 100644 --- a/src/color/writer.go +++ b/src/color/writer.go @@ -15,7 +15,6 @@ type Writer interface { String() (string, int) SetColors(background, foreground string) SetParentColors(background, foreground string) - ClearParentColors() } // AnsiWriter writes colorized ANSI strings @@ -101,10 +100,6 @@ func (a *AnsiWriter) SetParentColors(background, foreground string) { }}, a.ParentColors...) } -func (a *AnsiWriter) ClearParentColors() { - a.ParentColors = nil -} - func (a *AnsiWriter) getAnsiFromColorString(colorString string, isBackground bool) AnsiColor { return a.AnsiColors.AnsiColorFromString(colorString, isBackground) } diff --git a/src/engine/block.go b/src/engine/block.go index 8f2c3d01..42121742 100644 --- a/src/engine/block.go +++ b/src/engine/block.go @@ -137,7 +137,6 @@ func (b *Block) RenderSegments() (string, int) { b.renderActiveSegment() } b.writePowerline(true) - b.writer.ClearParentColors() return b.writer.String() }