diff --git a/src/engine/block.go b/src/engine/block.go index a0cce216..e2c6eea1 100644 --- a/src/engine/block.go +++ b/src/engine/block.go @@ -151,7 +151,7 @@ func (b *Block) renderActiveSegment() { b.writer.Write(ansi.Background, ansi.Foreground, b.activeSegment.text) case Diamond: background := ansi.Transparent - if b.previousActiveSegment != nil && !b.previousActiveSegment.hasTrailingDiamond() { + if b.previousActiveSegment != nil && b.previousActiveSegment.hasEmptyDiamondAtEnd() { background = b.previousActiveSegment.background() } b.writer.Write(background, ansi.Background, b.activeSegment.LeadingDiamond) diff --git a/src/engine/segment.go b/src/engine/segment.go index 7e739cb0..1f02612e 100644 --- a/src/engine/segment.go +++ b/src/engine/segment.go @@ -376,9 +376,12 @@ func (segment *Segment) isPowerline() bool { return style == Powerline || style == Accordion } -func (segment *Segment) hasTrailingDiamond() bool { - style := segment.style() - return style == Diamond && len(segment.TrailingDiamond) > 0 +func (segment *Segment) hasEmptyDiamondAtEnd() bool { + if segment.style() != Diamond { + return false + } + + return len(segment.TrailingDiamond) == 0 } func (segment *Segment) cwdIncluded() bool {