From 36c318a02ad52808980698255b8cbc702955edae Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Tue, 28 Sep 2021 20:20:02 +0200 Subject: [PATCH] fix: set correct color for diamonds on inheritance --- src/block.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/block.go b/src/block.go index 8467b101..32058eff 100644 --- a/src/block.go +++ b/src/block.go @@ -161,9 +161,13 @@ func (b *Block) renderPlainSegment(text string) { } func (b *Block) renderDiamondSegment(text string) { - b.writer.write(Transparent, b.activeSegment.background(), b.activeSegment.LeadingDiamond) + background := b.activeSegment.background() + if background == Inherit { + background = b.previousActiveSegment.background() + } + b.writer.write(Transparent, background, b.activeSegment.LeadingDiamond) b.renderText(text) - b.writer.write(Transparent, b.activeSegment.background(), b.activeSegment.TrailingDiamond) + b.writer.write(Transparent, background, b.activeSegment.TrailingDiamond) } func (b *Block) renderText(text string) {