summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDavyd McColl <davydm@gmail.com>2021-06-07 10:08:38 +0200
committerJesse Duffield <jessedduffield@gmail.com>2021-07-01 17:13:14 +1000
commit16dcc8f4db29c0557fbdf81bd8e85eb7e86916b0 (patch)
treebec0b61e4716e6f905299628d0acfcad36761a41 /pkg
parenteb10ddfccc7623df769c839c95c475588f566bb2 (diff)
:sparkles: implement feedback when toggling whitespace
Diffstat (limited to 'pkg')
-rw-r--r--pkg/config/user_config.go2
-rw-r--r--pkg/gui/quitting.go7
-rw-r--r--pkg/i18n/english.go4
3 files changed, 13 insertions, 0 deletions
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index f87567ac0..18962376e 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -166,6 +166,8 @@ type KeybindingUniversalConfig struct {
AppendNewline string `yaml:"appendNewline"`
ExtrasMenu string `yaml:"extrasMenu"`
ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"`
+ IgnoringWhitespaceInDiffView string `yaml:"ignoringWhitespaceInDiffView"`
+ ShowingWhitespaceInDiffView string `yaml:"showingWhitespaceInDiffView"`
}
type KeybindingStatusConfig struct {
diff --git a/pkg/gui/quitting.go b/pkg/gui/quitting.go
index 8abe2e121..7509589ac 100644
--- a/pkg/gui/quitting.go
+++ b/pkg/gui/quitting.go
@@ -31,6 +31,13 @@ func (gui *Gui) handleQuitWithoutChangingDirectory() error {
func (gui *Gui) toggleWhitespaceInDiffView() error {
gui.State.IgnoreWhitespaceInDiffView = !gui.State.IgnoreWhitespaceInDiffView
+ var toastMessage string
+ if gui.State.IgnoreWhitespaceInDiffView {
+ toastMessage = gui.Tr.IgnoringWhitespaceInDiffView
+ } else {
+ toastMessage = gui.Tr.ShowingWhitespaceInDiffView
+ }
+ gui.raiseToast(toastMessage)
return gui.refreshFilesAndSubmodules()
}
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index 755f7c1be..960958209 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -452,6 +452,8 @@ type TranslationSet struct {
RandomTip string
SelectParentCommitForMerge string
ToggleWhitespaceInDiffView string
+ IgnoringWhitespaceInDiffView string
+ ShowingWhitespaceInDiffView string
Spans Spans
}
@@ -997,6 +999,8 @@ func englishTranslationSet() TranslationSet {
RandomTip: "Random Tip",
SelectParentCommitForMerge: "Select parent commit for merge",
ToggleWhitespaceInDiffView: "Toggle whether or not whitespace changes are shown in the diff view",
+ IgnoringWhitespaceInDiffView: "Whitespace will be ignored in the diff view",
+ ShowingWhitespaceInDiffView: "Whitespace will be shown in the diff view",
Spans: Spans{
// TODO: combine this with the original keybinding descriptions (those are all in lowercase atm)
CheckoutCommit: "Checkout commit",