Skip to content

Commit

Permalink
feat: allow null in keybindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryooooooga committed Oct 18, 2022
1 parent 36c6462 commit 14ec0cd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion pkg/gui/keybindings/keybindings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion pkg/gui/options_menu_panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 14ec0cd

Please sign in to comment.