mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-04-23 12:18:51 +02:00
allow resetting to tag
This commit is contained in:
parent
8ca9f93ccf
commit
f528e12c83
@ -577,6 +577,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||||||
Handler: gui.handleCreateTag,
|
Handler: gui.handleCreateTag,
|
||||||
Description: gui.Tr.SLocalize("createTag"),
|
Description: gui.Tr.SLocalize("createTag"),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
ViewName: "branches",
|
||||||
|
Contexts: []string{"tags"},
|
||||||
|
Key: gui.getKey("commits.viewResetOptions"),
|
||||||
|
Modifier: gocui.ModNone,
|
||||||
|
Handler: gui.handleCreateResetToTagMenu,
|
||||||
|
Description: gui.Tr.SLocalize("resetToThisTag"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
ViewName: "branches",
|
ViewName: "branches",
|
||||||
Key: gui.getKey("universal.nextTab"),
|
Key: gui.getKey("universal.nextTab"),
|
||||||
|
@ -140,3 +140,12 @@ func (gui *Gui) handleCreateTag(g *gocui.Gui, v *gocui.View) error {
|
|||||||
return gui.refreshTags()
|
return gui.refreshTags()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) handleCreateResetToTagMenu(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
tag := gui.getSelectedTag()
|
||||||
|
if tag == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return gui.createResetMenu(tag.Name)
|
||||||
|
}
|
||||||
|
@ -945,6 +945,9 @@ func addEnglish(i18nObject *i18n.Bundle) error {
|
|||||||
}, &i18n.Message{
|
}, &i18n.Message{
|
||||||
ID: "resetToThisBranch",
|
ID: "resetToThisBranch",
|
||||||
Other: "reset to the HEAD of this branch",
|
Other: "reset to the HEAD of this branch",
|
||||||
|
}, &i18n.Message{
|
||||||
|
ID: "resetToThisTag",
|
||||||
|
Other: "reset to this tag",
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user