mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
parent
35edf3a93d
commit
389262edd0
|
@ -12,6 +12,9 @@ import (
|
|||
"oh-my-posh/segments"
|
||||
"oh-my-posh/shell"
|
||||
"oh-my-posh/template"
|
||||
|
||||
c "golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
// Segment represent a single segment and it's configuration
|
||||
|
@ -397,7 +400,7 @@ func (segment *Segment) SetEnabled(env platform.Environment) {
|
|||
segment.Enabled = true
|
||||
name := segment.Alias
|
||||
if len(name) == 0 {
|
||||
name = string(segment.Type)
|
||||
name = c.Title(language.English).String(string(segment.Type))
|
||||
}
|
||||
env.TemplateCache().AddSegmentData(name, segment.writer)
|
||||
}
|
||||
|
|
|
@ -24,8 +24,6 @@ import (
|
|||
"time"
|
||||
|
||||
process "github.com/shirou/gopsutil/v3/process"
|
||||
"golang.org/x/text/cases"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -158,7 +156,6 @@ func (t *TemplateCache) AddSegmentData(key string, value interface{}) {
|
|||
if t.Segments == nil {
|
||||
t.Segments = make(map[string]interface{})
|
||||
}
|
||||
key = cases.Title(language.English).String(key)
|
||||
t.Segments[key] = value
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue