mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-25 19:14:50 -08:00
parent
c2734a97a5
commit
7768cb2984
|
@ -72,6 +72,7 @@ type Segment struct {
|
||||||
Enabled bool `json:"-" toml:"-"`
|
Enabled bool `json:"-" toml:"-"`
|
||||||
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
|
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
|
||||||
InvertPowerline bool `json:"invert_powerline,omitempty" toml:"invert_powerline,omitempty"`
|
InvertPowerline bool `json:"invert_powerline,omitempty" toml:"invert_powerline,omitempty"`
|
||||||
|
restored bool `json:"-" toml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (segment *Segment) Name() string {
|
func (segment *Segment) Name() string {
|
||||||
|
@ -238,11 +239,13 @@ func (segment *Segment) restoreCache() bool {
|
||||||
|
|
||||||
log.Debug("restored segment from cache: ", segment.Name())
|
log.Debug("restored segment from cache: ", segment.Name())
|
||||||
|
|
||||||
|
segment.restored = true
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (segment *Segment) setCache() {
|
func (segment *Segment) setCache() {
|
||||||
if !segment.hasCache() {
|
if segment.restored || !segment.hasCache() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue