1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-10 04:07:18 +02:00
lazygit/pkg/gui/whitespace-toggle.go

18 lines
444 B
Go
Raw Normal View History

package gui
import (
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
func (gui *Gui) toggleWhitespaceInDiffView() error {
2022-01-28 11:44:36 +02:00
gui.IgnoreWhitespaceInDiffView = !gui.IgnoreWhitespaceInDiffView
toastMessage := gui.c.Tr.ShowingWhitespaceInDiffView
2022-01-28 11:44:36 +02:00
if gui.IgnoreWhitespaceInDiffView {
toastMessage = gui.c.Tr.IgnoringWhitespaceInDiffView
}
gui.c.Toast(toastMessage)
return gui.currentSideListContext().HandleFocus(types.OnFocusOpts{})
}