From 4a272afc6726655b216cce91e2d1c33447875467 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 27 Jul 2024 21:55:41 +0200 Subject: [PATCH] Reinitialize gui.ShowExtrasWindow after loading user config --- pkg/gui/gui.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 582047ab9..109ac7ce9 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -395,6 +395,11 @@ func (gui *Gui) onUserConfigLoaded() error { gui.previousLanguageConfig = userConfig.Gui.Language } + // originally we could only hide the command log permanently via the config + // but now we do it via state. So we need to still support the config for the + // sake of backwards compatibility. We're making use of short circuiting here + gui.ShowExtrasWindow = userConfig.Gui.ShowCommandLog && !gui.c.GetAppState().HideCommandLog + return nil } @@ -534,10 +539,10 @@ func NewGui( RepoStateMap: map[Repo]*GuiRepoState{}, GuiLog: []string{}, - // originally we could only hide the command log permanently via the config - // but now we do it via state. So we need to still support the config for the - // sake of backwards compatibility. We're making use of short circuiting here - ShowExtrasWindow: cmn.UserConfig().Gui.ShowCommandLog && !config.GetAppState().HideCommandLog, + // initializing this to true for the time being; it will be reset to the + // real value after loading the user config: + ShowExtrasWindow: true, + Mutexes: types.Mutexes{ RefreshingFilesMutex: &deadlock.Mutex{}, RefreshingBranchesMutex: &deadlock.Mutex{},