summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/basic_commits_controller.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/gui/controllers/basic_commits_controller.go')
-rw-r--r--pkg/gui/controllers/basic_commits_controller.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/pkg/gui/controllers/basic_commits_controller.go b/pkg/gui/controllers/basic_commits_controller.go
index 45239ef68..5a4e4190e 100644
--- a/pkg/gui/controllers/basic_commits_controller.go
+++ b/pkg/gui/controllers/basic_commits_controller.go
@@ -106,6 +106,14 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [
GetDisabledReason: self.require(self.singleItemSelected()),
Description: self.c.Tr.OpenDiffTool,
},
+ // Putting this at the bottom of the list so that it has the lowest priority,
+ // meaning that if the user has configured another keybinding to the same key
+ // then that will take precedence.
+ {
+ // Hardcoding this key because it's not configurable
+ Key: opts.GetKey("c"),
+ Handler: self.handleOldCherryPickKey,
+ },
}
return bindings
@@ -284,6 +292,16 @@ func (self *BasicCommitsController) copyRange(*models.Commit) error {
return self.c.Helpers().CherryPick.CopyRange(self.context.GetCommits(), self.context)
}
+func (self *BasicCommitsController) handleOldCherryPickKey() error {
+ msg := utils.ResolvePlaceholderString(self.c.Tr.OldCherryPickKeyWarning,
+ map[string]string{
+ "copy": keybindings.Label(self.c.UserConfig.Keybinding.Commits.CherryPickCopy),
+ "paste": keybindings.Label(self.c.UserConfig.Keybinding.Commits.PasteCommits),
+ })
+
+ return self.c.ErrorMsg(msg)
+}
+
func (self *BasicCommitsController) openDiffTool(commit *models.Commit) error {
to := commit.RefName()
from, reverse := self.c.Modes().Diffing.GetFromAndReverseArgsForDiff(commit.ParentRefName())