1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00
lazygit/pkg/gui/whitespace-toggle.go
stk bbaeab68e1 Better redrawing after toggling "ignore whitespace"
There's no need for refreshing anything; all that's needed is to re-focus the
selected list item. This way it will also work in other panels, which we are
about to add in the next commit.
2023-02-07 12:09:17 +01:00

18 lines
444 B
Go

package gui
import (
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
func (gui *Gui) toggleWhitespaceInDiffView() error {
gui.IgnoreWhitespaceInDiffView = !gui.IgnoreWhitespaceInDiffView
toastMessage := gui.c.Tr.ShowingWhitespaceInDiffView
if gui.IgnoreWhitespaceInDiffView {
toastMessage = gui.c.Tr.IgnoringWhitespaceInDiffView
}
gui.c.Toast(toastMessage)
return gui.currentSideListContext().HandleFocus(types.OnFocusOpts{})
}