Visualize the "ignore whitespace" state in the subtitle of the diff view

This commit is contained in:
Stefan Haller 2023-05-18 15:29:37 +02:00 committed by Jesse Duffield
parent 7d4bfb6621
commit 64b2685c2d
9 changed files with 38 additions and 17 deletions

View file

@ -59,8 +59,9 @@ func (self *DiffHelper) RenderDiff() error {
return self.c.RenderToMainViews(types.RefreshMainOpts{
Pair: self.c.MainViewPairs().Normal,
Main: &types.ViewUpdateOpts{
Title: "Diff",
Task: task,
Title: "Diff",
SubTitle: self.IgnoringWhitespaceSubTitle(),
Task: task,
},
})
}
@ -112,3 +113,11 @@ func (self *DiffHelper) WithDiffModeCheck(f func() error) error {
return f()
}
func (self *DiffHelper) IgnoringWhitespaceSubTitle() string {
if self.c.State().GetIgnoreWhitespaceInDiffView() {
return self.c.Tr.IgnoreWhitespaceDiffViewSubTitle
}
return ""
}