mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-21 02:55:37 -08:00
fix(diamond): join segments when no trailing diamond
This commit is contained in:
parent
060b712bbe
commit
a5fc8dbed5
|
@ -150,7 +150,11 @@ func (b *Block) renderActiveSegment() {
|
|||
case Plain, Powerline:
|
||||
b.writer.Write(ansi.Background, ansi.Foreground, b.activeSegment.text)
|
||||
case Diamond:
|
||||
b.writer.Write(ansi.Transparent, ansi.Background, b.activeSegment.LeadingDiamond)
|
||||
background := ansi.Transparent
|
||||
if b.previousActiveSegment != nil && !b.previousActiveSegment.hasTrailingDiamond() {
|
||||
background = b.previousActiveSegment.background()
|
||||
}
|
||||
b.writer.Write(background, ansi.Background, b.activeSegment.LeadingDiamond)
|
||||
b.writer.Write(ansi.Background, ansi.Foreground, b.activeSegment.text)
|
||||
case Accordion:
|
||||
if b.activeSegment.Enabled {
|
||||
|
|
|
@ -376,6 +376,11 @@ 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) cwdIncluded() bool {
|
||||
value, ok := segment.Properties[properties.IncludeFolders]
|
||||
if !ok {
|
||||
|
|
Loading…
Reference in a new issue