summaryrefslogtreecommitdiffstats
path: root/pkg/gui/keybindings.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-26 16:33:52 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commitf2c85c5b19176a959ac5d98f57749ee6bc9c362b (patch)
tree4e9578df83dd22464d62deaaf816b4811d2bdf18 /pkg/gui/keybindings.go
parent0faa41e6f8e13818c611ad923fa424c83653d06a (diff)
move side window actions to controllers package
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r--pkg/gui/keybindings.go29
1 files changed, 0 insertions, 29 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index fa536b65d..d7fa758fa 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -74,8 +74,6 @@ func (self *Gui) keybindingOpts() types.KeybindingsOpts {
// renaming receiver to 'self' to aid refactoring. Will probably end up moving all Gui handlers to this pattern eventually.
func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBinding) {
- config := self.c.UserConfig.Keybinding
-
opts := self.c.KeybindingsOpts()
bindings := []*types.Binding{
@@ -317,33 +315,6 @@ func (self *Gui) GetInitialKeybindings() ([]*types.Binding, []*gocui.ViewMouseBi
mouseKeybindings = append(mouseKeybindings, c.GetMouseKeybindings(opts)...)
}
- for _, viewName := range []string{"status", "remotes", "tags", "localBranches", "remoteBranches", "files", "submodules", "reflogCommits", "commits", "commitFiles", "subCommits", "stash"} {
- bindings = append(bindings, []*types.Binding{
- {ViewName: viewName, Key: opts.GetKey(opts.Config.Universal.PrevBlock), Modifier: gocui.ModNone, Handler: self.previousSideWindow},
- {ViewName: viewName, Key: opts.GetKey(opts.Config.Universal.NextBlock), Modifier: gocui.ModNone, Handler: self.nextSideWindow},
- {ViewName: viewName, Key: opts.GetKey(opts.Config.Universal.PrevBlockAlt), Modifier: gocui.ModNone, Handler: self.previousSideWindow},
- {ViewName: viewName, Key: opts.GetKey(opts.Config.Universal.NextBlockAlt), Modifier: gocui.ModNone, Handler: self.nextSideWindow},
- {ViewName: viewName, Key: opts.GetKey(opts.Config.Universal.PrevBlockAlt2), Modifier: gocui.ModNone, Handler: self.previousSideWindow},
- {ViewName: viewName, Key: opts.GetKey(opts.Config.Universal.NextBlockAlt2), Modifier: gocui.ModNone, Handler: self.nextSideWindow},
- }...)
- }
-
- // Appends keybindings to jump to a particular sideView using numbers
- windows := []string{"status", "files", "branches", "commits", "stash"}
-
- if len(config.Universal.JumpToBlock) != len(windows) {
- log.Fatal("Jump to block keybindings cannot be set. Exactly 5 keybindings must be supplied.")
- } else {
- for i, window := range windows {
- bindings = append(bindings, &types.Binding{
- ViewName: "",
- Key: opts.GetKey(opts.Config.Universal.JumpToBlock[i]),
- Modifier: gocui.ModNone,
- Handler: self.goToSideWindow(window),
- })
- }
- }
-
bindings = append(bindings, []*types.Binding{
{
ViewName: "",