mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-13 00:56:25 -04:00
use Key if it's a rune, otherwise KeyReadable
This commit is contained in:
parent
7ec5b6cc30
commit
265d7e121a
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue