summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/helpers
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2023-05-18 15:29:37 +0200
committerJesse Duffield <jessedduffield@gmail.com>2023-05-20 12:58:32 +1000
commit64b2685c2dfc34a5cb7f2870e06d649339cc3ccf (patch)
treedda795b927abdd65852e0376b93cf5a3d98a9a42 /pkg/gui/controllers/helpers
parent7d4bfb6621163244b5467ab6e6c40571726d7c81 (diff)
Visualize the "ignore whitespace" state in the subtitle of the diff view
Diffstat (limited to 'pkg/gui/controllers/helpers')
-rw-r--r--pkg/gui/controllers/helpers/diff_helper.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkg/gui/controllers/helpers/diff_helper.go b/pkg/gui/controllers/helpers/diff_helper.go
index 701df93cd..8d18be2bf 100644
--- a/pkg/gui/controllers/helpers/diff_helper.go
+++ b/pkg/gui/controllers/helpers/diff_helper.go
@@ -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 ""
+}