mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
refactor keybindings
This commit is contained in:
parent
2db4636815
commit
226985bf76
19 changed files with 215 additions and 201 deletions
|
@ -4,7 +4,6 @@ import (
|
|||
"github.com/jesseduffield/lazygit/pkg/commands"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
|
||||
"github.com/jesseduffield/lazygit/pkg/config"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
@ -64,19 +63,15 @@ type reflogAction struct {
|
|||
to string
|
||||
}
|
||||
|
||||
func (self *UndoController) Keybindings(
|
||||
getKey func(key string) interface{},
|
||||
config config.KeybindingConfig,
|
||||
guards types.KeybindingGuards,
|
||||
) []*types.Binding {
|
||||
func (self *UndoController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
|
||||
bindings := []*types.Binding{
|
||||
{
|
||||
Key: getKey(config.Universal.Undo),
|
||||
Key: opts.GetKey(opts.Config.Universal.Undo),
|
||||
Handler: self.reflogUndo,
|
||||
Description: self.c.Tr.LcUndoReflog,
|
||||
},
|
||||
{
|
||||
Key: getKey(config.Universal.Redo),
|
||||
Key: opts.GetKey(opts.Config.Universal.Redo),
|
||||
Handler: self.reflogRedo,
|
||||
Description: self.c.Tr.LcRedoReflog,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue