mirror of
https://github.com/jesseduffield/lazygit.git
synced 2024-11-24 08:52:21 +02:00
✨ always show whitespace in diffs when entering line-by-line staging
This commit is contained in:
parent
92cc6e883d
commit
130480555f
@ -33,6 +33,10 @@ 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)
|
||||
|
@ -1,7 +1,15 @@
|
||||
package gui
|
||||
|
||||
func (gui *Gui) toggleWhitespaceInDiffView() error {
|
||||
gui.State.IgnoreWhitespaceInDiffView = !gui.State.IgnoreWhitespaceInDiffView
|
||||
return gui.setIgnoreWhitespaceFlag(!gui.State.IgnoreWhitespaceInDiffView)
|
||||
}
|
||||
|
||||
func (gui *Gui) setIgnoreWhitespaceFlag(shouldIgnoreWhitespace bool) error {
|
||||
if gui.State.IgnoreWhitespaceInDiffView == shouldIgnoreWhitespace {
|
||||
return nil
|
||||
}
|
||||
|
||||
gui.State.IgnoreWhitespaceInDiffView = shouldIgnoreWhitespace
|
||||
|
||||
toastMessage := gui.Tr.ShowingWhitespaceInDiffView
|
||||
if gui.State.IgnoreWhitespaceInDiffView {
|
||||
|
Loading…
Reference in New Issue
Block a user