diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-01 08:18:16 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-02 08:09:42 +1000 |
commit | da3e00823f733743c2bd8076d13955dbed9fcbae (patch) | |
tree | 0b9a5dfa358fe8e1d0b0d53ebb897282548a4581 /pkg/gui/keybindings.go | |
parent | f3be2b3e68a49742ee88053a1d029926bc0d1819 (diff) |
allow submodule init and show submodule diff with a prefix
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r-- | pkg/gui/keybindings.go | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 1c1fa6c9a..992f32313 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -1562,13 +1562,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }, { ViewName: "files", - Contexts: []string{SUBMODULES_CONTEXT_KEY}, - Key: gui.getKey("universal.goInto"), - Handler: gui.wrappedHandler(gui.handleSubmoduleEnter), - Description: gui.Tr.SLocalize("enterSubmodule"), - }, - { - ViewName: "files", Key: gui.getKey("universal.nextTab"), Handler: gui.handleNextTab, Description: gui.Tr.SLocalize("nextTab"), @@ -1587,18 +1580,25 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Description: gui.Tr.SLocalize("copySubmoduleNameToClipboard"), }, { + ViewName: "files", + Contexts: []string{SUBMODULES_CONTEXT_KEY}, + Key: gui.getKey("universal.goInto"), + Handler: gui.forSubmodule(gui.handleSubmoduleEnter), + Description: gui.Tr.SLocalize("enterSubmodule"), + }, + { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey("universal.remove"), - Handler: gui.wrappedHandler(gui.handleRemoveSubmodule), + Handler: gui.forSubmodule(gui.handleRemoveSubmodule), Description: gui.Tr.SLocalize("removeSubmodule"), }, { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey("u"), - Handler: gui.wrappedHandler(gui.handleResetSubmodule), + Handler: gui.forSubmodule(gui.handleResetSubmodule), Description: gui.Tr.SLocalize("submoduleStashAndReset"), }, { @@ -1612,9 +1612,16 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { ViewName: "files", Contexts: []string{SUBMODULES_CONTEXT_KEY}, Key: gui.getKey("universal.edit"), - Handler: gui.wrappedHandler(gui.handleEditSubmoduleUrl), + Handler: gui.forSubmodule(gui.handleEditSubmoduleUrl), Description: gui.Tr.SLocalize("editSubmoduleUrl"), }, + { + ViewName: "files", + Contexts: []string{SUBMODULES_CONTEXT_KEY}, + Key: gui.getKey("submodules.init"), + Handler: gui.forSubmodule(gui.handleSubmoduleInit), + Description: gui.Tr.SLocalize("initSubmodule"), + }, } for _, viewName := range []string{"status", "branches", "files", "commits", "commitFiles", "stash", "menu"} { |