mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-01-10 04:07:18 +02:00
22 lines
595 B
Go
22 lines
595 B
Go
package gui
|
|
|
|
func (gui *Gui) toggleWhitespaceInDiffView() error {
|
|
return gui.setIgnoreWhitespaceFlag(!gui.State.IgnoreWhitespaceInDiffView)
|
|
}
|
|
|
|
func (gui *Gui) setIgnoreWhitespaceFlag(shouldIgnoreWhitespace bool) error {
|
|
if gui.State.IgnoreWhitespaceInDiffView == shouldIgnoreWhitespace {
|
|
return nil
|
|
}
|
|
|
|
gui.State.IgnoreWhitespaceInDiffView = shouldIgnoreWhitespace
|
|
|
|
toastMessage := gui.Tr.ShowingWhitespaceInDiffView
|
|
if gui.State.IgnoreWhitespaceInDiffView {
|
|
toastMessage = gui.Tr.IgnoringWhitespaceInDiffView
|
|
}
|
|
gui.raiseToast(toastMessage)
|
|
|
|
return gui.refreshFilesAndSubmodules()
|
|
}
|