diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-06 18:50:52 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-08-07 11:16:03 +1000 |
commit | 7410acd1aaa97f678295a328264360802346b33a (patch) | |
tree | 51dc6b5dfc8c0b67711ff644a6bc32480e6eaea8 /pkg/gui/services | |
parent | 445a625b56a79be6cee7ec1ee35fe9f4fcc2daad (diff) |
move merge conflicts code into controller
Diffstat (limited to 'pkg/gui/services')
-rw-r--r-- | pkg/gui/services/custom_commands/client.go | 3 | ||||
-rw-r--r-- | pkg/gui/services/custom_commands/keybinding_creator.go | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/pkg/gui/services/custom_commands/client.go b/pkg/gui/services/custom_commands/client.go index a3452067c..aeaae084e 100644 --- a/pkg/gui/services/custom_commands/client.go +++ b/pkg/gui/services/custom_commands/client.go @@ -23,11 +23,10 @@ func NewClient( git *commands.GitCommand, contexts *context.ContextTree, helpers *helpers.Helpers, - getKey func(string) types.Key, ) *Client { sessionStateLoader := NewSessionStateLoader(contexts, helpers) handlerCreator := NewHandlerCreator(c, os, git, sessionStateLoader) - keybindingCreator := NewKeybindingCreator(contexts, getKey) + keybindingCreator := NewKeybindingCreator(contexts) customCommands := c.UserConfig.CustomCommands return &Client{ diff --git a/pkg/gui/services/custom_commands/keybinding_creator.go b/pkg/gui/services/custom_commands/keybinding_creator.go index 7df044c28..7251225fe 100644 --- a/pkg/gui/services/custom_commands/keybinding_creator.go +++ b/pkg/gui/services/custom_commands/keybinding_creator.go @@ -8,19 +8,18 @@ import ( "github.com/jesseduffield/gocui" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/gui/context" + "github.com/jesseduffield/lazygit/pkg/gui/keybindings" "github.com/jesseduffield/lazygit/pkg/gui/types" ) // KeybindingCreator takes a custom command along with its handler and returns a corresponding keybinding type KeybindingCreator struct { contexts *context.ContextTree - getKey func(string) types.Key } -func NewKeybindingCreator(contexts *context.ContextTree, getKey func(string) types.Key) *KeybindingCreator { +func NewKeybindingCreator(contexts *context.ContextTree) *KeybindingCreator { return &KeybindingCreator{ contexts: contexts, - getKey: getKey, } } @@ -41,7 +40,7 @@ func (self *KeybindingCreator) call(customCommand config.CustomCommand, handler return &types.Binding{ ViewName: viewName, - Key: self.getKey(customCommand.Key), + Key: keybindings.GetKey(customCommand.Key), Modifier: gocui.ModNone, Handler: handler, Description: description, |