mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 22:07:25 -08:00
feat(color): do not clear parent colors
This commit is contained in:
parent
60664e245a
commit
8cd8c9a7be
|
@ -15,7 +15,6 @@ type PlainWriter struct {
|
||||||
|
|
||||||
func (a *PlainWriter) SetColors(background, foreground string) {}
|
func (a *PlainWriter) SetColors(background, foreground string) {}
|
||||||
func (a *PlainWriter) SetParentColors(background, foreground string) {}
|
func (a *PlainWriter) SetParentColors(background, foreground string) {}
|
||||||
func (a *PlainWriter) ClearParentColors() {}
|
|
||||||
|
|
||||||
func (a *PlainWriter) Write(background, foreground, text string) {
|
func (a *PlainWriter) Write(background, foreground, text string) {
|
||||||
if len(text) == 0 {
|
if len(text) == 0 {
|
||||||
|
|
|
@ -15,7 +15,6 @@ type Writer interface {
|
||||||
String() (string, int)
|
String() (string, int)
|
||||||
SetColors(background, foreground string)
|
SetColors(background, foreground string)
|
||||||
SetParentColors(background, foreground string)
|
SetParentColors(background, foreground string)
|
||||||
ClearParentColors()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnsiWriter writes colorized ANSI strings
|
// AnsiWriter writes colorized ANSI strings
|
||||||
|
@ -101,10 +100,6 @@ func (a *AnsiWriter) SetParentColors(background, foreground string) {
|
||||||
}}, a.ParentColors...)
|
}}, a.ParentColors...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AnsiWriter) ClearParentColors() {
|
|
||||||
a.ParentColors = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (a *AnsiWriter) getAnsiFromColorString(colorString string, isBackground bool) AnsiColor {
|
func (a *AnsiWriter) getAnsiFromColorString(colorString string, isBackground bool) AnsiColor {
|
||||||
return a.AnsiColors.AnsiColorFromString(colorString, isBackground)
|
return a.AnsiColors.AnsiColorFromString(colorString, isBackground)
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,6 @@ func (b *Block) RenderSegments() (string, int) {
|
||||||
b.renderActiveSegment()
|
b.renderActiveSegment()
|
||||||
}
|
}
|
||||||
b.writePowerline(true)
|
b.writePowerline(true)
|
||||||
b.writer.ClearParentColors()
|
|
||||||
return b.writer.String()
|
return b.writer.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue