feat(color): do not clear parent colors

This commit is contained in:
Jan De Dobbeleer 2022-12-28 17:08:36 +01:00 committed by Jan De Dobbeleer
parent 60664e245a
commit 8cd8c9a7be
3 changed files with 0 additions and 7 deletions

View file

@ -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 {

View file

@ -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)
}

View file

@ -137,7 +137,6 @@ func (b *Block) RenderSegments() (string, int) {
b.renderActiveSegment()
}
b.writePowerline(true)
b.writer.ClearParentColors()
return b.writer.String()
}