2021-06-11 14:34:00 +02:00
|
|
|
package gui
|
|
|
|
|
2023-02-07 10:17:43 +02:00
|
|
|
import (
|
|
|
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
|
|
|
)
|
|
|
|
|
2021-06-11 14:34:00 +02:00
|
|
|
func (gui *Gui) toggleWhitespaceInDiffView() error {
|
2022-01-28 11:44:36 +02:00
|
|
|
gui.IgnoreWhitespaceInDiffView = !gui.IgnoreWhitespaceInDiffView
|
2021-06-11 14:34:00 +02:00
|
|
|
|
2022-01-16 05:46:53 +02:00
|
|
|
toastMessage := gui.c.Tr.ShowingWhitespaceInDiffView
|
2022-01-28 11:44:36 +02:00
|
|
|
if gui.IgnoreWhitespaceInDiffView {
|
2022-01-16 05:46:53 +02:00
|
|
|
toastMessage = gui.c.Tr.IgnoringWhitespaceInDiffView
|
2021-06-11 14:34:00 +02:00
|
|
|
}
|
2022-01-16 05:46:53 +02:00
|
|
|
gui.c.Toast(toastMessage)
|
2021-06-11 14:34:00 +02:00
|
|
|
|
2023-02-07 10:17:43 +02:00
|
|
|
return gui.currentSideListContext().HandleFocus(types.OnFocusOpts{})
|
2021-06-11 14:34:00 +02:00
|
|
|
}
|