diff --git a/pkg/gui/controllers/basic_commits_controller.go b/pkg/gui/controllers/basic_commits_controller.go index aec24838bb7..13ecd43d036 100644 --- a/pkg/gui/controllers/basic_commits_controller.go +++ b/pkg/gui/controllers/basic_commits_controller.go @@ -76,6 +76,11 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ Handler: self.c.Helpers().CherryPick.Reset, Description: self.c.Tr.ResetCherryPick, }, + { + Key: opts.GetKey(opts.Config.Universal.OpenDiffTool), + Handler: self.checkSelected(self.openDiffTool), + Description: self.c.Tr.OpenDiffTool, + }, } return bindings @@ -251,3 +256,11 @@ func (self *BasicCommitsController) copy(commit *models.Commit) error { func (self *BasicCommitsController) copyRange(*models.Commit) error { return self.c.Helpers().CherryPick.CopyRange(self.context.GetSelectedLineIdx(), self.context.GetCommits(), self.context) } + +func (self *BasicCommitsController) openDiffTool(commit *models.Commit) error { + to := commit.RefName() + from, reverse := self.c.Modes().Diffing.GetFromAndReverseArgsForDiff(commit.ParentRefName()) + _, err := self.c.RunSubprocess(self.c.Git().File.OpenDiffToolCmdObj( + from, to, reverse, ".", true)) + return err +}