diff options
Diffstat (limited to 'pkg/config')
-rw-r--r-- | pkg/config/app_config.go | 13 | ||||
-rw-r--r-- | pkg/config/dummies.go | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 74f675576..b1b1acb0c 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -45,6 +45,7 @@ type AppConfigurer interface { SetIsNewRepo(bool) GetIsNewRepo() bool ReloadUserConfig() error + ShowCommandLogOnStartup() bool } // NewAppConfig makes a new app config @@ -276,6 +277,17 @@ func (c *AppConfig) SaveAppState() error { return err } +// 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 +func (c *AppConfig) ShowCommandLogOnStartup() bool { + if !c.UserConfig.Gui.ShowCommandLog { + return false + } + + return !c.AppState.HideCommandLog +} + // loadAppState loads recorded AppState from file func loadAppState() (*AppState, error) { filepath, err := configFilePath("state.yml") @@ -314,6 +326,7 @@ type AppState struct { // these are for custom commands typed in directly, not for custom commands in the lazygit config CustomCommandsHistory []string + HideCommandLog bool } func getDefaultAppState() *AppState { diff --git a/pkg/config/dummies.go b/pkg/config/dummies.go index 40548d732..bd973909a 100644 --- a/pkg/config/dummies.go +++ b/pkg/config/dummies.go @@ -14,6 +14,7 @@ func NewDummyAppConfig() *AppConfig { Debug: false, BuildSource: "", UserConfig: GetDefaultConfig(), + AppState: &AppState{}, } _ = yaml.Unmarshal([]byte{}, appConfig.AppState) return appConfig |