1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-30 09:16:47 +02:00

allow resetting cherry picked commits selection

This commit is contained in:
Jesse Duffield 2020-03-19 08:45:21 +11:00
parent dadb646252
commit 8fbcc36331
5 changed files with 18 additions and 0 deletions

View File

@ -128,6 +128,7 @@ Default path for the config file:
tagCommit: 'T'
toggleDiffCommit: 'i'
checkoutCommit: '<space>'
resetCherryPick: '<c-R>'
stash:
popStash: 'g'
commitFiles:

View File

@ -360,6 +360,7 @@ keybinding:
tagCommit: 'T'
toggleDiffCommit: 'i'
checkoutCommit: '<space>'
resetCherryPick: '<c-R>'
stash:
popStash: 'g'
commitFiles:

View File

@ -642,3 +642,8 @@ func (gui *Gui) handleOpenSearchForCommitsPanel(g *gocui.Gui, v *gocui.View) err
return gui.handleOpenSearch(gui.g, v)
}
func (gui *Gui) handleResetCherryPick(g *gocui.Gui, v *gocui.View) error {
gui.State.CherryPickedCommits = []*commands.Commit{}
return gui.refreshCommits(gui.g)
}

View File

@ -840,6 +840,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Handler: gui.handleTagCommit,
Description: gui.Tr.SLocalize("tagCommit"),
},
{
ViewName: "commits",
Contexts: []string{"branch-commits"},
Key: gui.getKey("commits.resetCherryPick"),
Modifier: gocui.ModNone,
Handler: gui.handleResetCherryPick,
Description: gui.Tr.SLocalize("resetCherryPick"),
},
{
ViewName: "commits",
Contexts: []string{"reflog-commits"},

View File

@ -1032,6 +1032,9 @@ func addEnglish(i18nObject *i18n.Bundle) error {
}, &i18n.Message{
ID: "closeMenu",
Other: "close menu",
}, &i18n.Message{
ID: "resetCherryPick",
Other: "reset cherry-picked (copied) commits selection",
},
)
}