diff --git a/pkg/gui/staging_panel.go b/pkg/gui/staging_panel.go index 69a005688..1fb9e8989 100644 --- a/pkg/gui/staging_panel.go +++ b/pkg/gui/staging_panel.go @@ -33,13 +33,9 @@ func (gui *Gui) refreshStagingPanel(forceSecondaryFocused bool, selectedLineIdx gui.Views.Secondary.Title = gui.Tr.StagedChanges } - // if we were ignoring whitespace, stop doing that so that - // line-by-line diffs work as expected - _ = gui.setIgnoreWhitespaceFlag(false) - // note for custom diffs, we'll need to send a flag here saying not to use the custom diff - diff := gui.GitCommand.WorktreeFileDiff(file, true, secondaryFocused, gui.State.IgnoreWhitespaceInDiffView) - secondaryDiff := gui.GitCommand.WorktreeFileDiff(file, true, !secondaryFocused, gui.State.IgnoreWhitespaceInDiffView) + diff := gui.GitCommand.WorktreeFileDiff(file, true, secondaryFocused, false) + secondaryDiff := gui.GitCommand.WorktreeFileDiff(file, true, !secondaryFocused, false) // if we have e.g. a deleted file with nothing else to the diff will have only // 4-5 lines in which case we'll swap panels diff --git a/pkg/gui/whitespace-toggle.go b/pkg/gui/whitespace-toggle.go index 697770a94..e7df9d879 100644 --- a/pkg/gui/whitespace-toggle.go +++ b/pkg/gui/whitespace-toggle.go @@ -1,15 +1,7 @@ package gui func (gui *Gui) toggleWhitespaceInDiffView() error { - return gui.setIgnoreWhitespaceFlag(!gui.State.IgnoreWhitespaceInDiffView) -} - -func (gui *Gui) setIgnoreWhitespaceFlag(shouldIgnoreWhitespace bool) error { - if gui.State.IgnoreWhitespaceInDiffView == shouldIgnoreWhitespace { - return nil - } - - gui.State.IgnoreWhitespaceInDiffView = shouldIgnoreWhitespace + gui.State.IgnoreWhitespaceInDiffView = !gui.State.IgnoreWhitespaceInDiffView toastMessage := gui.Tr.ShowingWhitespaceInDiffView if gui.State.IgnoreWhitespaceInDiffView {