1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Extract a SaveAppStateAndLogError function

It seems that most actions that change a state option and resave the state want
to just log the error.
This commit is contained in:
Stefan Haller
2023-08-28 13:18:58 +02:00
parent 1dac4158e9
commit 1106981827
4 changed files with 9 additions and 6 deletions

View File

@ -24,9 +24,7 @@ func (self *ToggleWhitespaceAction) Call() error {
}
self.c.GetAppState().IgnoreWhitespaceInDiffView = !self.c.GetAppState().IgnoreWhitespaceInDiffView
if err := self.c.SaveAppState(); err != nil {
self.c.Log.Errorf("error when saving app state: %v", err)
}
self.c.SaveAppStateAndLogError()
return self.c.CurrentSideContext().HandleFocus(types.OnFocusOpts{})
}