From 7768cb2984b2bc5e5e490c6ba5e359318fa05088 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 14 Dec 2024 14:15:58 +0100 Subject: [PATCH] fix(segment): do not set cache when restored resolves #6011 --- src/config/segment.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config/segment.go b/src/config/segment.go index f1b14751..c86f6262 100644 --- a/src/config/segment.go +++ b/src/config/segment.go @@ -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 { @@ -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 }