Skip to content

Commit

Permalink
fix(segment): do not set cache when restored
Browse files Browse the repository at this point in the history
resolves #6011
  • Loading branch information
JanDeDobbeleer committed Dec 14, 2024
1 parent c2734a9 commit 7768cb2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/config/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type Segment struct {
Enabled bool `json:"-" toml:"-"`
Newline bool `json:"newline,omitempty" toml:"newline,omitempty"`
InvertPowerline bool `json:"invert_powerline,omitempty" toml:"invert_powerline,omitempty"`
restored bool `json:"-" toml:"-"`
}

func (segment *Segment) Name() string {
Expand Down Expand Up @@ -238,11 +239,13 @@ func (segment *Segment) restoreCache() bool {

log.Debug("restored segment from cache: ", segment.Name())

segment.restored = true

return true
}

func (segment *Segment) setCache() {
if !segment.hasCache() {
if segment.restored || !segment.hasCache() {
return
}

Expand Down

0 comments on commit 7768cb2

Please sign in to comment.