fix: wrong background for powerline in some cases

activeBackground color is wrong when a diamong segment follows a
powerline segment.
This commit is contained in:
lnu 2021-10-29 15:38:52 +02:00 committed by Jan De Dobbeleer
parent 7197d58080
commit 1b29ae136d

View file

@ -89,6 +89,9 @@ func (b *Block) renderSegments() string {
continue
}
b.activeSegment = segment
b.activeBackground = b.activeSegment.background()
b.activeForeground = b.activeSegment.foreground()
b.writer.setColors(b.activeBackground, b.activeForeground)
b.endPowerline()
b.renderSegmentText(segment.stringValue)
}
@ -140,9 +143,6 @@ func (b *Block) getPowerlineColor(foreground bool) string {
}
func (b *Block) renderSegmentText(text string) {
b.activeBackground = b.activeSegment.background()
b.activeForeground = b.activeSegment.foreground()
b.writer.setColors(b.activeBackground, b.activeForeground)
switch b.activeSegment.Style {
case Plain:
b.renderPlainSegment(text)