1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-23 22:50:41 +02:00

mention path in tooltips

This commit is contained in:
Jesse Duffield 2023-02-19 13:11:33 +11:00
parent 31b8524fe6
commit 38c7030b0f
3 changed files with 31 additions and 10 deletions

0
lxGxGkGpXF Normal file
View File

View File

@ -5,6 +5,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/gui/context" "github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/filetree" "github.com/jesseduffield/lazygit/pkg/gui/filetree"
"github.com/jesseduffield/lazygit/pkg/gui/types" "github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
) )
// splitting this action out into its own file because it's self-contained // splitting this action out into its own file because it's self-contained
@ -51,8 +52,13 @@ func (self *FilesRemoveController) remove(node *filetree.FileNode) error {
} }
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}}) return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
}, },
Key: 'x', Key: 'x',
Tooltip: self.c.Tr.DiscardAllTooltip, Tooltip: utils.ResolvePlaceholderString(
self.c.Tr.DiscardAllTooltip,
map[string]string{
"path": node.GetPath(),
},
),
}, },
} }
@ -67,8 +73,13 @@ func (self *FilesRemoveController) remove(node *filetree.FileNode) error {
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}}) return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
}, },
Key: 'u', Key: 'u',
Tooltip: self.c.Tr.DiscardUnstagedTooltip, Tooltip: utils.ResolvePlaceholderString(
self.c.Tr.DiscardUnstagedTooltip,
map[string]string{
"path": node.GetPath(),
},
),
}) })
} }
} else { } else {
@ -97,8 +108,13 @@ func (self *FilesRemoveController) remove(node *filetree.FileNode) error {
} }
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}}) return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
}, },
Key: 'x', Key: 'x',
Tooltip: self.c.Tr.DiscardAllTooltip, Tooltip: utils.ResolvePlaceholderString(
self.c.Tr.DiscardAllTooltip,
map[string]string{
"path": node.GetPath(),
},
),
}, },
} }
@ -113,8 +129,13 @@ func (self *FilesRemoveController) remove(node *filetree.FileNode) error {
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}}) return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC, Scope: []types.RefreshableView{types.FILES}})
}, },
Key: 'u', Key: 'u',
Tooltip: self.c.Tr.DiscardUnstagedTooltip, Tooltip: utils.ResolvePlaceholderString(
self.c.Tr.DiscardUnstagedTooltip,
map[string]string{
"path": node.GetPath(),
},
),
}) })
} }
} }

View File

@ -764,8 +764,8 @@ func EnglishTranslationSet() TranslationSet {
LcRedoReflog: "redo (via reflog) (experimental)", LcRedoReflog: "redo (via reflog) (experimental)",
UndoTooltip: "The reflog will be used to determine what git command to run to undo the last git command. This does not include changes to the working tree; only commits are taken into consideration.", UndoTooltip: "The reflog will be used to determine what git command to run to undo the last git command. This does not include changes to the working tree; only commits are taken into consideration.",
RedoTooltip: "The reflog will be used to determine what git command to run to redo the last git command. This does not include changes to the working tree; only commits are taken into consideration.", RedoTooltip: "The reflog will be used to determine what git command to run to redo the last git command. This does not include changes to the working tree; only commits are taken into consideration.",
DiscardAllTooltip: "Discard both staged and unstaged changes.", DiscardAllTooltip: "Discard both staged and unstaged changes in '{{.path}}'.",
DiscardUnstagedTooltip: "Discard unstaged changes.", DiscardUnstagedTooltip: "Discard unstaged changes in '{{.path}}'.",
LcPop: "pop", LcPop: "pop",
LcDrop: "drop", LcDrop: "drop",
LcApply: "apply", LcApply: "apply",