diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-02-05 10:31:07 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | 226985bf7602763f7578ef236bdc4cec3a1494e9 (patch) | |
tree | 3a12b9d41099902e411fe32df3b79d31e8a8f375 /pkg/gui/controllers/menu_controller.go | |
parent | 2db463681564e8db945cd6811fc633545ee9fd83 (diff) |
refactor keybindings
Diffstat (limited to 'pkg/gui/controllers/menu_controller.go')
-rw-r--r-- | pkg/gui/controllers/menu_controller.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/pkg/gui/controllers/menu_controller.go b/pkg/gui/controllers/menu_controller.go index 7773a0148..7c93ef6f7 100644 --- a/pkg/gui/controllers/menu_controller.go +++ b/pkg/gui/controllers/menu_controller.go @@ -2,7 +2,6 @@ package controllers import ( "github.com/jesseduffield/gocui" - "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/gui/types" ) @@ -27,18 +26,18 @@ func NewMenuController( } } -func (self *MenuController) Keybindings(getKey func(key string) interface{}, config config.KeybindingConfig, guards types.KeybindingGuards) []*types.Binding { +func (self *MenuController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding { bindings := []*types.Binding{ { - Key: getKey(config.Universal.Select), + Key: opts.GetKey(opts.Config.Universal.Select), Handler: self.press, }, { - Key: getKey(config.Universal.Confirm), + Key: opts.GetKey(opts.Config.Universal.Confirm), Handler: self.press, }, { - Key: getKey(config.Universal.ConfirmAlt1), + Key: opts.GetKey(opts.Config.Universal.ConfirmAlt1), Handler: self.press, }, { @@ -47,7 +46,7 @@ func (self *MenuController) Keybindings(getKey func(key string) interface{}, con }, } - return append(bindings, self.context.Keybindings(getKey, config, guards)...) + return bindings } func (self *MenuController) press() error { |