1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02:00

use Key if it's a rune, otherwise KeyReadable

This commit is contained in:
Dawid Dziurla
2018-09-01 13:06:53 +02:00
parent 7ec5b6cc30
commit 265d7e121a

View File

@@ -54,8 +54,17 @@ func (gui *Gui) handleHelp(g *gocui.Gui, v *gocui.View) error {
bindings := gui.getKeybindings()
for _, binding := range bindings {
if binding.ViewName == v.Name() && binding.Description != "" && binding.KeyReadable != "" {
content += fmt.Sprintf(" %s - %s\n", binding.KeyReadable, binding.Description)
r, ok := binding.Key.(rune)
key := ""
if ok {
key = string(r)
} else if binding.KeyReadable != "" {
key = binding.KeyReadable
}
if key != "" && binding.ViewName == v.Name() && binding.Description != "" {
content += fmt.Sprintf(" %s - %s\n", key, binding.Description)
keys = append(keys, binding)
}
}