diff options
author | Sam Burville <Sam.Burville@GlobalProcessing.com> | 2021-10-15 21:00:24 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-10-22 22:38:26 +1100 |
commit | 91e8765d9ca04aa88377f07d8abe665fb8fc66fe (patch) | |
tree | 35a9eb97cd0e50ecc23e3057c80072899100bb97 /pkg/gui | |
parent | 80a8e9b04d6fe5214136f92c644e5a412a94c59e (diff) |
Add JumpToBlock keybinding
This should allow users to decide their own keybinding for jumping
between blocks/panels.
E.g. A user could choose 5-9 instead of 1-5.
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/keybindings.go | 6 | ||||
-rw-r--r-- | pkg/gui/view_helpers.go | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 844a1dc8a..1678ee03c 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -1819,7 +1819,11 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { // Appends keybindings to jump to a particular sideView using numbers for i, window := range []string{"status", "files", "branches", "commits", "stash"} { - bindings = append(bindings, &Binding{ViewName: "", Key: rune(i+1) + '0', Modifier: gocui.ModNone, Handler: gui.goToSideWindow(window)}) + bindings = append(bindings, &Binding{ + ViewName: "", + Key: gui.getKey(config.Universal.JumpToBlock[i]), + Modifier: gocui.ModNone, + Handler: gui.goToSideWindow(window)}) } for viewName := range gui.State.Contexts.initialViewTabContextMap() { diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index abfb65d93..ce836c59b 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -322,7 +322,7 @@ func (gui *Gui) globalOptionsMap() map[string]string { gui.getKeyDisplay(keybindingConfig.Universal.Return): gui.Tr.LcCancel, gui.getKeyDisplay(keybindingConfig.Universal.Quit): gui.Tr.LcQuit, gui.getKeyDisplay(keybindingConfig.Universal.OptionMenu): gui.Tr.LcMenu, - "1-5": gui.Tr.LcJump, + fmt.Sprintf("%s-%s", gui.getKeyDisplay(keybindingConfig.Universal.JumpToBlock[0]), gui.getKeyDisplay(keybindingConfig.Universal.JumpToBlock[4])): gui.Tr.LcJump, } } |