1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

centralise logic for rendering options map

This commit is contained in:
Jesse Duffield
2020-08-23 10:50:27 +10:00
parent f876d8fdc8
commit fda9f4ea7a
6 changed files with 43 additions and 37 deletions

View File

@ -32,13 +32,12 @@ func (gui *Gui) handleMenuSelect() error {
// specific functions
func (gui *Gui) renderMenuOptions() error {
optionsMap := map[string]string{
func (gui *Gui) getMenuOptions() map[string]string {
return map[string]string{
gui.getKeyDisplay("universal.return"): gui.Tr.SLocalize("close"),
fmt.Sprintf("%s %s", gui.getKeyDisplay("universal.prevItem"), gui.getKeyDisplay("universal.nextItem")): gui.Tr.SLocalize("navigate"),
gui.getKeyDisplay("universal.select"): gui.Tr.SLocalize("execute"),
}
return gui.renderOptionsMap(optionsMap)
}
func (gui *Gui) handleMenuClose(g *gocui.Gui, v *gocui.View) error {