mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
fix(segment): only join diamonds with no diamond at end
This commit is contained in:
parent
a5fc8dbed5
commit
bb2ac0cec5
|
@ -151,7 +151,7 @@ func (b *Block) renderActiveSegment() {
|
||||||
b.writer.Write(ansi.Background, ansi.Foreground, b.activeSegment.text)
|
b.writer.Write(ansi.Background, ansi.Foreground, b.activeSegment.text)
|
||||||
case Diamond:
|
case Diamond:
|
||||||
background := ansi.Transparent
|
background := ansi.Transparent
|
||||||
if b.previousActiveSegment != nil && !b.previousActiveSegment.hasTrailingDiamond() {
|
if b.previousActiveSegment != nil && b.previousActiveSegment.hasEmptyDiamondAtEnd() {
|
||||||
background = b.previousActiveSegment.background()
|
background = b.previousActiveSegment.background()
|
||||||
}
|
}
|
||||||
b.writer.Write(background, ansi.Background, b.activeSegment.LeadingDiamond)
|
b.writer.Write(background, ansi.Background, b.activeSegment.LeadingDiamond)
|
||||||
|
|
|
@ -376,9 +376,12 @@ func (segment *Segment) isPowerline() bool {
|
||||||
return style == Powerline || style == Accordion
|
return style == Powerline || style == Accordion
|
||||||
}
|
}
|
||||||
|
|
||||||
func (segment *Segment) hasTrailingDiamond() bool {
|
func (segment *Segment) hasEmptyDiamondAtEnd() bool {
|
||||||
style := segment.style()
|
if segment.style() != Diamond {
|
||||||
return style == Diamond && len(segment.TrailingDiamond) > 0
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
return len(segment.TrailingDiamond) == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (segment *Segment) cwdIncluded() bool {
|
func (segment *Segment) cwdIncluded() bool {
|
||||||
|
|
Loading…
Reference in a new issue