1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-04 03:48:07 +02:00

change menu keybinding from ? to x

This commit is contained in:
Dawid Dziurla 2018-09-05 15:55:24 +02:00
parent 08395ae76c
commit db2e2160a9
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B
3 changed files with 4 additions and 4 deletions

View File

@ -353,7 +353,7 @@ func (gui *Gui) renderGlobalOptions(g *gocui.Gui) error {
"PgUp/PgDn": gui.Tr.SLocalize("scroll"),
"← → ↑ ↓": gui.Tr.SLocalize("navigate"),
"esc/q": gui.Tr.SLocalize("close"),
"?": gui.Tr.SLocalize("menu"),
"x": gui.Tr.SLocalize("menu"),
})
}

View File

@ -71,7 +71,7 @@ func (gui *Gui) GetKeybindings() []Binding {
Description: gui.Tr.SLocalize("refresh"),
}, {
ViewName: "",
Key: '?',
Key: 'x',
Modifier: gocui.ModNone,
Handler: gui.handleMenu,
}, {

View File

@ -30,7 +30,7 @@ func main() {
file.WriteString("# Lazygit " + a.Tr.SLocalize("menu"))
for _, binding := range bindings {
if key := a.Gui.GetKey(binding); key != "" && (binding.Description != "" || key == "?") {
if key := a.Gui.GetKey(binding); key != "" && (binding.Description != "" || key == "x") {
if binding.ViewName != current {
current = binding.ViewName
if current == "" {
@ -44,7 +44,7 @@ func main() {
// workaround to include menu keybinding in cheatsheet
// could not add this Description field directly to keybindings.go,
// because then menu key would be displayed in menu itself and that is undesirable
if key == "?" {
if key == "x" {
binding.Description = a.Tr.SLocalize("menu")
}
content = fmt.Sprintf("\t<kbd>%s</kbd>%s %s\n", key, strings.TrimPrefix(utils.WithPadding(key, padWidth), key), binding.Description)