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

move merge conflicts code into controller

This commit is contained in:
Jesse Duffield
2022-08-06 18:50:52 +10:00
parent 445a625b56
commit 7410acd1aa
39 changed files with 682 additions and 652 deletions

View File

@ -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,