summaryrefslogtreecommitdiffstats
path: root/pkg/gui/keybindings.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 09:55:49 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commitf63ec38aae9800a05d1b39977c8b51f6f1d4201c (patch)
treeedf9faf72b0b14df16a8cc4a73c7ce12d0f2ef62 /pkg/gui/keybindings.go
parentf858c8e7509526b2e174e9aa83c54a4aea146b38 (diff)
genericise creating new branches off things
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r--pkg/gui/keybindings.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index 76e28fdf5..51fcdd2a2 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -496,7 +496,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
ViewName: "branches",
Contexts: []string{LOCAL_BRANCHES_CONTEXT_KEY},
Key: gui.getKey("universal.new"),
- Handler: gui.handleNewBranch,
+ Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem),
Description: gui.Tr.SLocalize("newBranch"),
},
{
@@ -801,7 +801,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
Key: gui.getKey("universal.new"),
Modifier: gocui.ModNone,
- Handler: gui.wrappedHandler(gui.handleNewBranchOffCommit),
+ Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem),
Description: gui.Tr.SLocalize("createNewBranchFromCommit"),
},
{
@@ -861,6 +861,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Description: gui.Tr.SLocalize("viewResetOptions"),
},
{
+ ViewName: "branches",
+ Contexts: []string{SUB_COMMITS_CONTEXT_KEY},
+ Key: gui.getKey("universal.new"),
+ Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem),
+ Description: gui.Tr.SLocalize("newBranch"),
+ },
+ {
ViewName: "stash",
Key: gui.getKey("universal.goInto"),
Handler: gui.wrappedHandler(gui.handleViewStashFiles),
@@ -1358,10 +1365,9 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
ViewName: "branches",
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},
Key: gui.getKey("universal.new"),
- Handler: gui.handleNewBranchOffRemote,
+ Handler: gui.wrappedHandler(gui.handleNewBranchOffCurrentItem),
Description: gui.Tr.SLocalize("newBranch"),
},
-
{
ViewName: "branches",
Contexts: []string{REMOTE_BRANCHES_CONTEXT_KEY},