diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2023-02-19 13:11:33 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2023-02-20 19:28:45 +1100 |
commit | 38c7030b0f1cd62417e59091ebe68b4d387060a5 (patch) | |
tree | 99a3d6cf9a9ec6d69ced5a5cc24a174a05ef164c | |
parent | 31b8524fe681345f5051c0b5d9b9c658a2b48c27 (diff) |
mention path in tooltips
-rw-r--r-- | lxGxGkGpXF | 0 | ||||
-rw-r--r-- | pkg/gui/controllers/files_remove_controller.go | 37 | ||||
-rw-r--r-- | pkg/i18n/english.go | 4 |
3 files changed, 31 insertions, 10 deletions
diff --git a/lxGxGkGpXF b/lxGxGkGpXF new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/lxGxGkGpXF diff --git a/pkg/gui/controllers/files_remove_controller.go b/pkg/gui/controllers/files_remove_controller.go index 85815fb49..646118550 100644 --- a/pkg/gui/controllers/files_remove_controller.go +++ b/pkg/gui/controllers/files_remove_controller.go @@ -5,6 +5,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/gui/context" "github.com/jesseduffield/lazygit/pkg/gui/filetree" "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 @@ -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}}) }, - Key: 'x', - Tooltip: self.c.Tr.DiscardAllTooltip, + Key: 'x', + 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}}) }, - Key: 'u', - Tooltip: self.c.Tr.DiscardUnstagedTooltip, + Key: 'u', + Tooltip: utils.ResolvePlaceholderString( + self.c.Tr.DiscardUnstagedTooltip, + map[string]string{ + "path": node.GetPath(), + }, + ), }) } } 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}}) }, - Key: 'x', - Tooltip: self.c.Tr.DiscardAllTooltip, + Key: 'x', + 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}}) }, - Key: 'u', - Tooltip: self.c.Tr.DiscardUnstagedTooltip, + Key: 'u', + Tooltip: utils.ResolvePlaceholderString( + self.c.Tr.DiscardUnstagedTooltip, + map[string]string{ + "path": node.GetPath(), + }, + ), }) } } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 58604315e..ed89592e8 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -764,8 +764,8 @@ func EnglishTranslationSet() TranslationSet { 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.", 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.", - DiscardUnstagedTooltip: "Discard unstaged changes.", + DiscardAllTooltip: "Discard both staged and unstaged changes in '{{.path}}'.", + DiscardUnstagedTooltip: "Discard unstaged changes in '{{.path}}'.", LcPop: "pop", LcDrop: "drop", LcApply: "apply", |