mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
update keybindings
This commit is contained in:
@ -21,6 +21,7 @@ type Binding struct {
|
||||
Modifier gocui.Modifier
|
||||
Description string
|
||||
Alternative string
|
||||
Tag string // e.g. 'navigation'. Used for grouping things in the cheatsheet
|
||||
}
|
||||
|
||||
// GetDisplayStrings returns the display string of a file
|
||||
@ -633,18 +634,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
Handler: gui.wrappedHandler(gui.handleSwitchToSubCommits),
|
||||
Description: gui.Tr.SLocalize("viewCommits"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Key: gui.getKey("universal.nextTab"),
|
||||
Handler: gui.handleNextTab,
|
||||
Description: gui.Tr.SLocalize("nextTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Key: gui.getKey("universal.prevTab"),
|
||||
Handler: gui.handlePrevTab,
|
||||
Description: gui.Tr.SLocalize("prevTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "branches",
|
||||
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
|
||||
@ -673,18 +662,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
Handler: gui.handleFetchRemote,
|
||||
Description: gui.Tr.SLocalize("fetchRemote"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Key: gui.getKey("universal.nextTab"),
|
||||
Handler: gui.handleNextTab,
|
||||
Description: gui.Tr.SLocalize("nextTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Key: gui.getKey("universal.prevTab"),
|
||||
Handler: gui.handlePrevTab,
|
||||
Description: gui.Tr.SLocalize("prevTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "commits",
|
||||
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
|
||||
@ -1560,18 +1537,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.wrappedHandler(gui.onMenuPress),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.nextTab"),
|
||||
Handler: gui.handleNextTab,
|
||||
Description: gui.Tr.SLocalize("nextTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Key: gui.getKey("universal.prevTab"),
|
||||
Handler: gui.handlePrevTab,
|
||||
Description: gui.Tr.SLocalize("prevTab"),
|
||||
},
|
||||
{
|
||||
ViewName: "files",
|
||||
Contexts: []string{SUBMODULES_CONTEXT_KEY},
|
||||
@ -1644,6 +1609,25 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
||||
bindings = append(bindings, &Binding{ViewName: "", Key: rune(i+1) + '0', Modifier: gocui.ModNone, Handler: gui.goToSideWindow(window)})
|
||||
}
|
||||
|
||||
for viewName := range gui.viewTabContextMap() {
|
||||
bindings = append(bindings, []*Binding{
|
||||
{
|
||||
ViewName: viewName,
|
||||
Key: gui.getKey("universal.nextTab"),
|
||||
Handler: gui.handleNextTab,
|
||||
Description: gui.Tr.SLocalize("nextTab"),
|
||||
Tag: "navigation",
|
||||
},
|
||||
{
|
||||
ViewName: viewName,
|
||||
Key: gui.getKey("universal.prevTab"),
|
||||
Handler: gui.handlePrevTab,
|
||||
Description: gui.Tr.SLocalize("prevTab"),
|
||||
Tag: "navigation",
|
||||
},
|
||||
}...)
|
||||
}
|
||||
|
||||
bindings = append(bindings, gui.getListContextKeyBindings()...)
|
||||
|
||||
return bindings
|
||||
|
Reference in New Issue
Block a user