1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00

Support select range for cherry pick

This requires us to change the 'v' keybinding for paste to something else,
now that 'v' is used globally for toggling range select. So I'm using
'shift+v' and I'm likewise changing 'c' to 'shift+c' for copying, so
that they're consistent.

We will need to clearly communicate this change in keybindings.
This commit is contained in:
Jesse Duffield
2024-01-13 17:40:28 +11:00
parent 54bd94ad24
commit 280b4d60f8
24 changed files with 148 additions and 104 deletions

View File

@ -14,6 +14,7 @@ var _ types.IController = &BasicCommitsController{}
type ContainsCommits interface {
types.Context
types.IListContext
GetSelected() *models.Commit
GetCommits() []*models.Commit
GetSelectedLineIdx() int
@ -64,13 +65,8 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [
},
{
Key: opts.GetKey(opts.Config.Commits.CherryPickCopy),
Handler: self.checkSelected(self.copy),
Description: self.c.Tr.CherryPickCopy,
},
{
Key: opts.GetKey(opts.Config.Commits.CherryPickCopyRange),
Handler: self.checkSelected(self.copyRange),
Description: self.c.Tr.CherryPickCopyRange,
Description: self.c.Tr.CherryPickCopy,
},
{
Key: opts.GetKey(opts.Config.Commits.ResetCherryPick),
@ -271,12 +267,8 @@ func (self *BasicCommitsController) checkout(commit *models.Commit) error {
})
}
func (self *BasicCommitsController) copy(commit *models.Commit) error {
return self.c.Helpers().CherryPick.Copy(commit, self.context.GetCommits(), self.context)
}
func (self *BasicCommitsController) copyRange(*models.Commit) error {
return self.c.Helpers().CherryPick.CopyRange(self.context.GetSelectedLineIdx(), self.context.GetCommits(), self.context)
return self.c.Helpers().CherryPick.CopyRange(self.context.GetCommits(), self.context)
}
func (self *BasicCommitsController) openDiffTool(commit *models.Commit) error {