mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-12-12 11:15:00 +02:00
22 lines
558 B
Go
22 lines
558 B
Go
|
package controllers
|
||
|
|
||
|
import (
|
||
|
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||
|
)
|
||
|
|
||
|
type ToggleWhitespaceAction struct {
|
||
|
c *ControllerCommon
|
||
|
}
|
||
|
|
||
|
func (self *ToggleWhitespaceAction) Call() error {
|
||
|
self.c.State().SetIgnoreWhitespaceInDiffView(!self.c.State().GetIgnoreWhitespaceInDiffView())
|
||
|
|
||
|
toastMessage := self.c.Tr.ShowingWhitespaceInDiffView
|
||
|
if self.c.State().GetIgnoreWhitespaceInDiffView() {
|
||
|
toastMessage = self.c.Tr.IgnoringWhitespaceInDiffView
|
||
|
}
|
||
|
self.c.Toast(toastMessage)
|
||
|
|
||
|
return self.c.CurrentSideContext().HandleFocus(types.OnFocusOpts{})
|
||
|
}
|