diff --git a/scripts/generate_cheatsheet.go b/scripts/generate_cheatsheet.go index 95012e2a4fc..86308901454 100644 --- a/scripts/generate_cheatsheet.go +++ b/scripts/generate_cheatsheet.go @@ -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 != "" { + if key := a.Gui.GetKey(binding); key != "" && (binding.Description != "" || key == "?") { if binding.ViewName != current { current = binding.ViewName if current == "" { @@ -41,6 +41,12 @@ func main() { content = fmt.Sprintf("\n\n## %s\n
\n", title)
 				file.WriteString(content)
 			}
+			// 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 == "?" {
+				binding.Description = a.Tr.SLocalize("menu")
+			}
 			content = fmt.Sprintf("\t%s%s  %s\n", key, strings.TrimPrefix(utils.WithPadding(key, padWidth), key), binding.Description)
 			file.WriteString(content)
 		}