2021-06-11 14:34:00 +02:00
|
|
|
package gui
|
|
|
|
|
|
|
|
func (gui *Gui) toggleWhitespaceInDiffView() error {
|
2021-06-11 15:19:15 +02:00
|
|
|
return gui.setIgnoreWhitespaceFlag(!gui.State.IgnoreWhitespaceInDiffView)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (gui *Gui) setIgnoreWhitespaceFlag(shouldIgnoreWhitespace bool) error {
|
|
|
|
if gui.State.IgnoreWhitespaceInDiffView == shouldIgnoreWhitespace {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
gui.State.IgnoreWhitespaceInDiffView = shouldIgnoreWhitespace
|
2021-06-11 14:34:00 +02:00
|
|
|
|
|
|
|
toastMessage := gui.Tr.ShowingWhitespaceInDiffView
|
|
|
|
if gui.State.IgnoreWhitespaceInDiffView {
|
|
|
|
toastMessage = gui.Tr.IgnoringWhitespaceInDiffView
|
|
|
|
}
|
|
|
|
gui.raiseToast(toastMessage)
|
|
|
|
|
|
|
|
return gui.refreshFilesAndSubmodules()
|
|
|
|
}
|