1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-11-29 22:48:24 +02: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"
)
@@ -43,11 +42,11 @@ func NewBisectController(
}
}
func (self *BisectController) Keybindings(getKey func(key string) interface{}, config config.KeybindingConfig, guards types.KeybindingGuards) []*types.Binding {
func (self *BisectController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
bindings := []*types.Binding{
{
Key: getKey(config.Commits.ViewBisectOptions),
Handler: guards.OutsideFilterMode(self.checkSelected(self.openMenu)),
Key: opts.GetKey(opts.Config.Commits.ViewBisectOptions),
Handler: opts.Guards.OutsideFilterMode(self.checkSelected(self.openMenu)),
Description: self.c.Tr.LcViewBisectOptions,
OpensMenu: true,
},

View File

@@ -87,10 +87,10 @@ func NewFilesController(
}
}
func (self *FilesController) Keybindings(getKey func(key string) interface{}, config config.KeybindingConfig, guards types.KeybindingGuards) []*types.Binding {
bindings := []*types.Binding{
func (self *FilesController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
return []*types.Binding{
{
Key: getKey(config.Universal.Select),
Key: opts.GetKey(opts.Config.Universal.Select),
Handler: self.checkSelectedFileNode(self.press),
Description: self.c.Tr.LcToggleStaged,
},
@@ -99,103 +99,101 @@ func (self *FilesController) Keybindings(getKey func(key string) interface{}, co
Handler: func() error { return self.context.HandleClick(self.checkSelectedFileNode(self.press)) },
},
{
Key: getKey("<c-b>"), // TODO: softcode
Key: opts.GetKey("<c-b>"), // TODO: softcode
Handler: self.handleStatusFilterPressed,
Description: self.c.Tr.LcFileFilter,
},
{
Key: getKey(config.Files.CommitChanges),
Key: opts.GetKey(opts.Config.Files.CommitChanges),
Handler: self.HandleCommitPress,
Description: self.c.Tr.CommitChanges,
},
{
Key: getKey(config.Files.CommitChangesWithoutHook),
Key: opts.GetKey(opts.Config.Files.CommitChangesWithoutHook),
Handler: self.HandleWIPCommitPress,
Description: self.c.Tr.LcCommitChangesWithoutHook,
},
{
Key: getKey(config.Files.AmendLastCommit),
Key: opts.GetKey(opts.Config.Files.AmendLastCommit),
Handler: self.handleAmendCommitPress,
Description: self.c.Tr.AmendLastCommit,
},
{
Key: getKey(config.Files.CommitChangesWithEditor),
Key: opts.GetKey(opts.Config.Files.CommitChangesWithEditor),
Handler: self.HandleCommitEditorPress,
Description: self.c.Tr.CommitChangesWithEditor,
},
{
Key: getKey(config.Universal.Edit),
Key: opts.GetKey(opts.Config.Universal.Edit),
Handler: self.checkSelectedFileNode(self.edit),
Description: self.c.Tr.LcEditFile,
},
{
Key: getKey(config.Universal.OpenFile),
Key: opts.GetKey(opts.Config.Universal.OpenFile),
Handler: self.Open,
Description: self.c.Tr.LcOpenFile,
},
{
Key: getKey(config.Files.IgnoreFile),
Key: opts.GetKey(opts.Config.Files.IgnoreFile),
Handler: self.checkSelectedFileNode(self.ignore),
Description: self.c.Tr.LcIgnoreFile,
},
{
Key: getKey(config.Universal.Remove),
Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.checkSelectedFileNode(self.remove),
Description: self.c.Tr.LcViewDiscardOptions,
OpensMenu: true,
},
{
Key: getKey(config.Files.RefreshFiles),
Key: opts.GetKey(opts.Config.Files.RefreshFiles),
Handler: self.refresh,
Description: self.c.Tr.LcRefreshFiles,
},
{
Key: getKey(config.Files.StashAllChanges),
Key: opts.GetKey(opts.Config.Files.StashAllChanges),
Handler: self.stash,
Description: self.c.Tr.LcStashAllChanges,
},
{
Key: getKey(config.Files.ViewStashOptions),
Key: opts.GetKey(opts.Config.Files.ViewStashOptions),
Handler: self.createStashMenu,
Description: self.c.Tr.LcViewStashOptions,
OpensMenu: true,
},
{
Key: getKey(config.Files.ToggleStagedAll),
Key: opts.GetKey(opts.Config.Files.ToggleStagedAll),
Handler: self.stageAll,
Description: self.c.Tr.LcToggleStagedAll,
},
{
Key: getKey(config.Universal.GoInto),
Key: opts.GetKey(opts.Config.Universal.GoInto),
Handler: self.enter,
Description: self.c.Tr.FileEnter,
},
{
ViewName: "",
Key: getKey(config.Universal.ExecuteCustomCommand),
Key: opts.GetKey(opts.Config.Universal.ExecuteCustomCommand),
Handler: self.handleCustomCommand,
Description: self.c.Tr.LcExecuteCustomCommand,
},
{
Key: getKey(config.Commits.ViewResetOptions),
Key: opts.GetKey(opts.Config.Commits.ViewResetOptions),
Handler: self.createResetMenu,
Description: self.c.Tr.LcViewResetToUpstreamOptions,
OpensMenu: true,
},
// here
{
Key: getKey(config.Files.ToggleTreeView),
Key: opts.GetKey(opts.Config.Files.ToggleTreeView),
Handler: self.toggleTreeView,
Description: self.c.Tr.LcToggleTreeView,
},
{
Key: getKey(config.Files.OpenMergeTool),
Key: opts.GetKey(opts.Config.Files.OpenMergeTool),
Handler: self.OpenMergeTool,
Description: self.c.Tr.LcOpenMergeTool,
},
}
return append(bindings, self.context.Keybindings(getKey, config, guards)...)
}
func (self *FilesController) press(node *filetree.FileNode) error {

View File

@@ -8,7 +8,6 @@ import (
"github.com/jesseduffield/lazygit/pkg/commands/hosting_service"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/commands/oscommands"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
)
@@ -91,108 +90,104 @@ func NewLocalCommitsController(
}
}
func (self *LocalCommitsController) Keybindings(
getKey func(key string) interface{},
config config.KeybindingConfig,
guards types.KeybindingGuards,
) []*types.Binding {
func (self *LocalCommitsController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
outsideFilterModeBindings := []*types.Binding{
{
Key: getKey(config.Commits.SquashDown),
Key: opts.GetKey(opts.Config.Commits.SquashDown),
Handler: self.squashDown,
Description: self.c.Tr.LcSquashDown,
},
{
Key: getKey(config.Commits.MarkCommitAsFixup),
Key: opts.GetKey(opts.Config.Commits.MarkCommitAsFixup),
Handler: self.fixup,
Description: self.c.Tr.LcFixupCommit,
},
{
Key: getKey(config.Commits.RenameCommit),
Key: opts.GetKey(opts.Config.Commits.RenameCommit),
Handler: self.checkSelected(self.reword),
Description: self.c.Tr.LcRewordCommit,
},
{
Key: getKey(config.Commits.RenameCommitWithEditor),
Key: opts.GetKey(opts.Config.Commits.RenameCommitWithEditor),
Handler: self.rewordEditor,
Description: self.c.Tr.LcRenameCommitEditor,
},
{
Key: getKey(config.Universal.Remove),
Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.drop,
Description: self.c.Tr.LcDeleteCommit,
},
{
Key: getKey(config.Universal.Edit),
Key: opts.GetKey(opts.Config.Universal.Edit),
Handler: self.edit,
Description: self.c.Tr.LcEditCommit,
},
{
Key: getKey(config.Commits.PickCommit),
Key: opts.GetKey(opts.Config.Commits.PickCommit),
Handler: self.pick,
Description: self.c.Tr.LcPickCommit,
},
{
Key: getKey(config.Commits.CreateFixupCommit),
Key: opts.GetKey(opts.Config.Commits.CreateFixupCommit),
Handler: self.checkSelected(self.handleCreateFixupCommit),
Description: self.c.Tr.LcCreateFixupCommit,
},
{
Key: getKey(config.Commits.SquashAboveCommits),
Key: opts.GetKey(opts.Config.Commits.SquashAboveCommits),
Handler: self.checkSelected(self.handleSquashAllAboveFixupCommits),
Description: self.c.Tr.LcSquashAboveCommits,
},
{
Key: getKey(config.Commits.MoveDownCommit),
Key: opts.GetKey(opts.Config.Commits.MoveDownCommit),
Handler: self.handleCommitMoveDown,
Description: self.c.Tr.LcMoveDownCommit,
},
{
Key: getKey(config.Commits.MoveUpCommit),
Key: opts.GetKey(opts.Config.Commits.MoveUpCommit),
Handler: self.handleCommitMoveUp,
Description: self.c.Tr.LcMoveUpCommit,
},
{
Key: getKey(config.Commits.AmendToCommit),
Key: opts.GetKey(opts.Config.Commits.AmendToCommit),
Handler: self.handleCommitAmendTo,
Description: self.c.Tr.LcAmendToCommit,
},
{
Key: getKey(config.Commits.RevertCommit),
Key: opts.GetKey(opts.Config.Commits.RevertCommit),
Handler: self.checkSelected(self.handleCommitRevert),
Description: self.c.Tr.LcRevertCommit,
},
{
Key: getKey(config.Universal.New),
Key: opts.GetKey(opts.Config.Universal.New),
Modifier: gocui.ModNone,
Handler: self.checkSelected(self.newBranch),
Description: self.c.Tr.LcCreateNewBranchFromCommit,
},
{
Key: getKey(config.Commits.CherryPickCopy),
Key: opts.GetKey(opts.Config.Commits.CherryPickCopy),
Handler: self.checkSelected(self.copy),
Description: self.c.Tr.LcCherryPickCopy,
},
{
Key: getKey(config.Commits.CherryPickCopyRange),
Key: opts.GetKey(opts.Config.Commits.CherryPickCopyRange),
Handler: self.checkSelected(self.copyRange),
Description: self.c.Tr.LcCherryPickCopyRange,
},
{
Key: getKey(config.Commits.PasteCommits),
Handler: guards.OutsideFilterMode(self.paste),
Key: opts.GetKey(opts.Config.Commits.PasteCommits),
Handler: opts.Guards.OutsideFilterMode(self.paste),
Description: self.c.Tr.LcPasteCommits,
},
// overriding these navigation keybindings because we might need to load
// more commits on demand
{
Key: getKey(config.Universal.StartSearch),
Key: opts.GetKey(opts.Config.Universal.StartSearch),
Handler: self.openSearch,
Description: self.c.Tr.LcStartSearch,
Tag: "navigation",
},
{
Key: getKey(config.Universal.GotoBottom),
Key: opts.GetKey(opts.Config.Universal.GotoBottom),
Handler: self.gotoBottom,
Description: self.c.Tr.LcGotoBottom,
Tag: "navigation",
@@ -204,49 +199,49 @@ func (self *LocalCommitsController) Keybindings(
}
for _, binding := range outsideFilterModeBindings {
binding.Handler = guards.OutsideFilterMode(binding.Handler)
binding.Handler = opts.Guards.OutsideFilterMode(binding.Handler)
}
bindings := append(outsideFilterModeBindings, []*types.Binding{
{
Key: getKey(config.Commits.OpenLogMenu),
Key: opts.GetKey(opts.Config.Commits.OpenLogMenu),
Handler: self.handleOpenLogMenu,
Description: self.c.Tr.LcOpenLogMenu,
OpensMenu: true,
},
{
Key: getKey(config.Commits.ViewResetOptions),
Key: opts.GetKey(opts.Config.Commits.ViewResetOptions),
Handler: self.checkSelected(self.handleCreateCommitResetMenu),
Description: self.c.Tr.LcResetToThisCommit,
},
{
Key: getKey(config.Universal.GoInto),
Key: opts.GetKey(opts.Config.Universal.GoInto),
Handler: self.checkSelected(self.enter),
Description: self.c.Tr.LcViewCommitFiles,
},
{
Key: getKey(config.Commits.CheckoutCommit),
Key: opts.GetKey(opts.Config.Commits.CheckoutCommit),
Handler: self.checkSelected(self.handleCheckoutCommit),
Description: self.c.Tr.LcCheckoutCommit,
},
{
Key: getKey(config.Commits.TagCommit),
Key: opts.GetKey(opts.Config.Commits.TagCommit),
Handler: self.checkSelected(self.handleTagCommit),
Description: self.c.Tr.LcTagCommit,
},
{
Key: getKey(config.Commits.CopyCommitMessageToClipboard),
Key: opts.GetKey(opts.Config.Commits.CopyCommitMessageToClipboard),
Handler: self.checkSelected(self.handleCopySelectedCommitMessageToClipboard),
Description: self.c.Tr.LcCopyCommitMessageToClipboard,
},
{
Key: getKey(config.Commits.OpenInBrowser),
Key: opts.GetKey(opts.Config.Commits.OpenInBrowser),
Handler: self.checkSelected(self.handleOpenCommitInBrowser),
Description: self.c.Tr.LcOpenCommitInBrowser,
},
}...)
return append(bindings, self.context.Keybindings(getKey, config, guards)...)
return bindings
}
func (self *LocalCommitsController) squashDown() error {

View File

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

View File

@@ -4,7 +4,6 @@ import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
@@ -40,10 +39,10 @@ func NewRemotesController(
}
}
func (self *RemotesController) Keybindings(getKey func(key string) interface{}, config config.KeybindingConfig, guards types.KeybindingGuards) []*types.Binding {
func (self *RemotesController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
bindings := []*types.Binding{
{
Key: getKey(config.Universal.GoInto),
Key: opts.GetKey(opts.Config.Universal.GoInto),
Handler: self.checkSelected(self.enter),
},
{
@@ -51,28 +50,28 @@ func (self *RemotesController) Keybindings(getKey func(key string) interface{},
Handler: func() error { return self.context.HandleClick(self.checkSelected(self.enter)) },
},
{
Key: getKey(config.Branches.FetchRemote),
Key: opts.GetKey(opts.Config.Branches.FetchRemote),
Handler: self.checkSelected(self.fetch),
Description: self.c.Tr.LcFetchRemote,
},
{
Key: getKey(config.Universal.New),
Key: opts.GetKey(opts.Config.Universal.New),
Handler: self.add,
Description: self.c.Tr.LcAddNewRemote,
},
{
Key: getKey(config.Universal.Remove),
Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.checkSelected(self.remove),
Description: self.c.Tr.LcRemoveRemote,
},
{
Key: getKey(config.Universal.Edit),
Key: opts.GetKey(opts.Config.Universal.Edit),
Handler: self.checkSelected(self.edit),
Description: self.c.Tr.LcEditRemote,
},
}
return append(bindings, self.context.Keybindings(getKey, config, guards)...)
return bindings
}
func (self *RemotesController) enter(remote *models.Remote) error {

View File

@@ -8,7 +8,6 @@ import (
"github.com/jesseduffield/gocui"
"github.com/jesseduffield/lazygit/pkg/commands"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/gui/types"
)
@@ -40,40 +39,40 @@ func NewSubmodulesController(
}
}
func (self *SubmodulesController) Keybindings(getKey func(key string) interface{}, config config.KeybindingConfig, guards types.KeybindingGuards) []*types.Binding {
bindings := []*types.Binding{
func (self *SubmodulesController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
return []*types.Binding{
{
Key: getKey(config.Universal.GoInto),
Key: opts.GetKey(opts.Config.Universal.GoInto),
Handler: self.checkSelected(self.enter),
Description: self.c.Tr.LcEnterSubmodule,
},
{
Key: getKey(config.Universal.Remove),
Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.checkSelected(self.remove),
Description: self.c.Tr.LcRemoveSubmodule,
},
{
Key: getKey(config.Submodules.Update),
Key: opts.GetKey(opts.Config.Submodules.Update),
Handler: self.checkSelected(self.update),
Description: self.c.Tr.LcSubmoduleUpdate,
},
{
Key: getKey(config.Universal.New),
Key: opts.GetKey(opts.Config.Universal.New),
Handler: self.add,
Description: self.c.Tr.LcAddSubmodule,
},
{
Key: getKey(config.Universal.Edit),
Key: opts.GetKey(opts.Config.Universal.Edit),
Handler: self.checkSelected(self.editURL),
Description: self.c.Tr.LcEditSubmoduleUrl,
},
{
Key: getKey(config.Submodules.Init),
Key: opts.GetKey(opts.Config.Submodules.Init),
Handler: self.checkSelected(self.init),
Description: self.c.Tr.LcInitSubmodule,
},
{
Key: getKey(config.Submodules.BulkMenu),
Key: opts.GetKey(opts.Config.Submodules.BulkMenu),
Handler: self.openBulkActionsMenu,
Description: self.c.Tr.LcViewBulkSubmoduleOptions,
OpensMenu: true,
@@ -83,8 +82,6 @@ func (self *SubmodulesController) Keybindings(getKey func(key string) interface{
Handler: func() error { return self.context.HandleClick(self.checkSelected(self.enter)) },
},
}
return append(bindings, self.context.Keybindings(getKey, config, guards)...)
}
func (self *SubmodulesController) enter(submodule *models.SubmoduleConfig) error {

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

View File

@@ -3,7 +3,6 @@ package controllers
import (
"github.com/jesseduffield/lazygit/pkg/commands"
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/gui/context"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/jesseduffield/lazygit/pkg/utils"
@@ -48,42 +47,42 @@ func NewTagsController(
}
}
func (self *TagsController) Keybindings(getKey func(key string) interface{}, config config.KeybindingConfig, guards types.KeybindingGuards) []*types.Binding {
func (self *TagsController) GetKeybindings(opts types.KeybindingsOpts) []*types.Binding {
bindings := []*types.Binding{
{
Key: getKey(config.Universal.Select),
Key: opts.GetKey(opts.Config.Universal.Select),
Handler: self.withSelectedTag(self.checkout),
Description: self.c.Tr.LcCheckout,
},
{
Key: getKey(config.Universal.Remove),
Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.withSelectedTag(self.delete),
Description: self.c.Tr.LcDeleteTag,
},
{
Key: getKey(config.Branches.PushTag),
Key: opts.GetKey(opts.Config.Branches.PushTag),
Handler: self.withSelectedTag(self.push),
Description: self.c.Tr.LcPushTag,
},
{
Key: getKey(config.Universal.New),
Key: opts.GetKey(opts.Config.Universal.New),
Handler: self.create,
Description: self.c.Tr.LcCreateTag,
},
{
Key: getKey(config.Commits.ViewResetOptions),
Key: opts.GetKey(opts.Config.Commits.ViewResetOptions),
Handler: self.withSelectedTag(self.createResetMenu),
Description: self.c.Tr.LcViewResetOptions,
OpensMenu: true,
},
{
Key: getKey(config.Universal.GoInto),
Key: opts.GetKey(opts.Config.Universal.GoInto),
Handler: self.withSelectedTag(self.enter),
Description: self.c.Tr.LcViewCommits,
},
}
return append(bindings, self.context.Keybindings(getKey, config, guards)...)
return bindings
}
func (self *TagsController) checkout(tag *models.Tag) error {

View File

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