mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-04 10:34:55 +02:00
bbaeab68e1
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.
18 lines
444 B
Go
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{})
|
|
}
|