From 14ec0cd92e94ecf60c0e2150b2d62d6987250f0e Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Sat, 15 Oct 2022 22:17:00 +0900 Subject: [PATCH] feat: allow `null` in keybindings --- docs/Config.md | 2 ++ pkg/gui/keybindings/keybindings.go | 1 - pkg/gui/options_menu_panel.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Config.md b/docs/Config.md index d0d90ea31..937fc847d 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -436,6 +436,8 @@ gui: For all possible keybinding options, check [Custom_Keybindings.md](https://github.com/jesseduffield/lazygit/blob/master/docs/keybindings/Custom_Keybindings.md) +You can disable certain key bindings by specifying `null`. + ### Example Keybindings For Colemak Users ```yaml diff --git a/pkg/gui/keybindings/keybindings.go b/pkg/gui/keybindings/keybindings.go index a59180b56..09833944f 100644 --- a/pkg/gui/keybindings/keybindings.go +++ b/pkg/gui/keybindings/keybindings.go @@ -179,6 +179,5 @@ func GetKey(key string) types.Key { } else if runeCount == 1 { return []rune(key)[0] } - log.Fatal("Key empty for keybinding: " + strings.ToLower(key)) return nil } diff --git a/pkg/gui/options_menu_panel.go b/pkg/gui/options_menu_panel.go index 909c97fc8..68c8aa49d 100644 --- a/pkg/gui/options_menu_panel.go +++ b/pkg/gui/options_menu_panel.go @@ -58,7 +58,7 @@ func (gui *Gui) handleCreateOptionsMenu() error { OpensMenu: binding.OpensMenu, Label: binding.Description, OnPress: func() error { - if binding.Key == nil { + if binding.Handler == nil { return nil }