mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
fix: do not render empty/whitespace segments
This commit is contained in:
parent
01bd42b3eb
commit
55ab413d6e
|
@ -8,6 +8,7 @@ import (
|
||||||
"oh-my-posh/segments"
|
"oh-my-posh/segments"
|
||||||
"oh-my-posh/template"
|
"oh-my-posh/template"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -160,7 +161,7 @@ func (segment *Segment) string() string {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err.Error()
|
return err.Error()
|
||||||
}
|
}
|
||||||
segment.active = len(text) > 0
|
segment.active = len(strings.TrimSpace(text)) > 0
|
||||||
return text
|
return text
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue