mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-27 03:49:40 -08:00
parent
1b29ae136d
commit
3a1cbb904c
|
@ -49,6 +49,7 @@ type colorWriter interface {
|
|||
reset()
|
||||
setColors(background, foreground string)
|
||||
setParentColors(background, foreground string)
|
||||
clearParentColors()
|
||||
}
|
||||
|
||||
// AnsiColor writes colorized strings
|
||||
|
@ -90,6 +91,10 @@ func (a *AnsiColor) setParentColors(background, foreground string) {
|
|||
}
|
||||
}
|
||||
|
||||
func (a *AnsiColor) clearParentColors() {
|
||||
a.ParentColors = nil
|
||||
}
|
||||
|
||||
// Gets the ANSI color code for a given color string.
|
||||
// This can include a valid hex color in the format `#FFFFFF`,
|
||||
// but also a name of one of the first 16 ANSI colors like `lightBlue`.
|
||||
|
|
|
@ -98,6 +98,7 @@ func (b *Block) renderSegments() string {
|
|||
if b.previousActiveSegment != nil && b.previousActiveSegment.Style == Powerline {
|
||||
b.writePowerLineSeparator(Transparent, b.previousActiveSegment.background(), true)
|
||||
}
|
||||
b.writer.clearParentColors()
|
||||
return b.writer.string()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue