1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-05-29 23:17:32 +02:00

Don't strike out reserved keys in menus (#3365)

It seems to cause more confusion than it helps.

Fixes #2819.
This commit is contained in:
Stefan Haller 2024-03-07 07:30:08 +01:00 committed by GitHub
commit ad017459d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,21 +92,8 @@ func (self *MenuViewModel) GetDisplayStrings(_ int, _ int) [][]string {
return displayStrings
}
// These keys are used for general navigation so we'll strike them out to
// avoid confusion
reservedKeys := []string{
self.c.UserConfig.Keybinding.Universal.Confirm,
self.c.UserConfig.Keybinding.Universal.Select,
self.c.UserConfig.Keybinding.Universal.Return,
self.c.UserConfig.Keybinding.Universal.StartSearch,
}
keyLabel := keybindings.LabelFromKey(item.Key)
keyStyle := style.FgCyan
if lo.Contains(reservedKeys, keyLabel) {
keyStyle = style.FgDefault.SetStrikethrough()
}
displayStrings = utils.Prepend(displayStrings, keyStyle.Sprint(keyLabel))
displayStrings = utils.Prepend(displayStrings, style.FgCyan.Sprint(keyLabel))
return displayStrings
})
}