mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
parent
1b29ae136d
commit
3a1cbb904c
|
@ -49,6 +49,7 @@ type colorWriter interface {
|
||||||
reset()
|
reset()
|
||||||
setColors(background, foreground string)
|
setColors(background, foreground string)
|
||||||
setParentColors(background, foreground string)
|
setParentColors(background, foreground string)
|
||||||
|
clearParentColors()
|
||||||
}
|
}
|
||||||
|
|
||||||
// AnsiColor writes colorized strings
|
// 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.
|
// Gets the ANSI color code for a given color string.
|
||||||
// This can include a valid hex color in the format `#FFFFFF`,
|
// 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`.
|
// 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 {
|
if b.previousActiveSegment != nil && b.previousActiveSegment.Style == Powerline {
|
||||||
b.writePowerLineSeparator(Transparent, b.previousActiveSegment.background(), true)
|
b.writePowerLineSeparator(Transparent, b.previousActiveSegment.background(), true)
|
||||||
}
|
}
|
||||||
|
b.writer.clearParentColors()
|
||||||
return b.writer.string()
|
return b.writer.string()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue