mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-19 12:12:42 +02:00
✨ implement feedback when toggling whitespace
This commit is contained in:
parent
eb10ddfccc
commit
16dcc8f4db
@ -166,6 +166,8 @@ type KeybindingUniversalConfig struct {
|
|||||||
AppendNewline string `yaml:"appendNewline"`
|
AppendNewline string `yaml:"appendNewline"`
|
||||||
ExtrasMenu string `yaml:"extrasMenu"`
|
ExtrasMenu string `yaml:"extrasMenu"`
|
||||||
ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"`
|
ToggleWhitespaceInDiffView string `yaml:"toggleWhitespaceInDiffView"`
|
||||||
|
IgnoringWhitespaceInDiffView string `yaml:"ignoringWhitespaceInDiffView"`
|
||||||
|
ShowingWhitespaceInDiffView string `yaml:"showingWhitespaceInDiffView"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type KeybindingStatusConfig struct {
|
type KeybindingStatusConfig struct {
|
||||||
|
@ -31,6 +31,13 @@ func (gui *Gui) handleQuitWithoutChangingDirectory() error {
|
|||||||
|
|
||||||
func (gui *Gui) toggleWhitespaceInDiffView() error {
|
func (gui *Gui) toggleWhitespaceInDiffView() error {
|
||||||
gui.State.IgnoreWhitespaceInDiffView = !gui.State.IgnoreWhitespaceInDiffView
|
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()
|
return gui.refreshFilesAndSubmodules()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,6 +452,8 @@ type TranslationSet struct {
|
|||||||
RandomTip string
|
RandomTip string
|
||||||
SelectParentCommitForMerge string
|
SelectParentCommitForMerge string
|
||||||
ToggleWhitespaceInDiffView string
|
ToggleWhitespaceInDiffView string
|
||||||
|
IgnoringWhitespaceInDiffView string
|
||||||
|
ShowingWhitespaceInDiffView string
|
||||||
Spans Spans
|
Spans Spans
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -997,6 +999,8 @@ func englishTranslationSet() TranslationSet {
|
|||||||
RandomTip: "Random Tip",
|
RandomTip: "Random Tip",
|
||||||
SelectParentCommitForMerge: "Select parent commit for merge",
|
SelectParentCommitForMerge: "Select parent commit for merge",
|
||||||
ToggleWhitespaceInDiffView: "Toggle whether or not whitespace changes are shown in the diff view",
|
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{
|
Spans: Spans{
|
||||||
// TODO: combine this with the original keybinding descriptions (those are all in lowercase atm)
|
// TODO: combine this with the original keybinding descriptions (those are all in lowercase atm)
|
||||||
CheckoutCommit: "Checkout commit",
|
CheckoutCommit: "Checkout commit",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user