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

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.
This commit is contained in:
Sam Burville
2021-10-15 21:00:24 +01:00
committed by Jesse Duffield
parent 80a8e9b04d
commit 91e8765d9c
4 changed files with 68 additions and 61 deletions

View File

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