1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

refactor keybindings

This commit is contained in:
Jesse Duffield
2022-02-05 10:31:07 +11:00
parent 2db4636815
commit 226985bf76
19 changed files with 215 additions and 201 deletions

View File

@ -7,7 +7,6 @@ import (
"github.com/jesseduffield/lazygit/pkg/commands"
"github.com/jesseduffield/lazygit/pkg/commands/git_commands"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
@ -46,16 +45,16 @@ func NewSyncController(
}
}
func (self *SyncController) Keybindings(getKey func(key string) interface{}, config config.KeybindingConfig, guards types.KeybindingGuards) []*types.Binding {
func (self *SyncController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
bindings := []*types.Binding{
{
Key: getKey(config.Universal.PushFiles),
Handler: guards.NoPopupPanel(self.HandlePush),
Key: opts.GetKey(opts.Config.Universal.PushFiles),
Handler: opts.Guards.NoPopupPanel(self.HandlePush),
Description: self.c.Tr.LcPush,
},
{
Key: getKey(config.Universal.PullFiles),
Handler: guards.NoPopupPanel(self.HandlePull),
Key: opts.GetKey(opts.Config.Universal.PullFiles),
Handler: opts.Guards.NoPopupPanel(self.HandlePull),
Description: self.c.Tr.LcPull,
},
}