mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 19:39:39 -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)
|
||||
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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue