mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-02-03 13:21:56 +02:00
workaround to include menu keybinding in cheatsheet
This commit is contained in:
parent
4188786749
commit
08395ae76c
@ -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("</pre>\n\n## %s\n<pre>\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<kbd>%s</kbd>%s %s\n", key, strings.TrimPrefix(utils.WithPadding(key, padWidth), key), binding.Description)
|
||||
file.WriteString(content)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user