summaryrefslogtreecommitdiffstats
path: root/pkg/gui/keybindings.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 11:05:37 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commitfbd61fcd17d495e9605bcf1f765663f861839cac (patch)
treed5d9eaa12e3e5fbefa5c50282af8f8207d5bb6a3 /pkg/gui/keybindings.go
parentb1529f19ad527d29a469de09c11c37d7f61d8d16 (diff)
refactor how we handle different modes
Diffstat (limited to 'pkg/gui/keybindings.go')
-rw-r--r--pkg/gui/keybindings.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index fed17e291..23724f385 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -758,7 +758,7 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
ViewName: "commits",
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
Key: gui.getKey("commits.cherryPickCopy"),
- Handler: gui.handleCopyCommit,
+ Handler: gui.wrappedHandler(gui.handleCopyCommit),
Description: gui.Tr.SLocalize("cherryPickCopy"),
},
{
@@ -772,14 +772,14 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
ViewName: "commits",
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
Key: gui.getKey("commits.cherryPickCopyRange"),
- Handler: gui.handleCopyCommitRange,
+ Handler: gui.wrappedHandler(gui.handleCopyCommitRange),
Description: gui.Tr.SLocalize("cherryPickCopyRange"),
},
{
ViewName: "commits",
Contexts: []string{BRANCH_COMMITS_CONTEXT_KEY},
Key: gui.getKey("commits.pasteCommits"),
- Handler: gui.HandlePasteCommits,
+ Handler: gui.wrappedHandler(gui.HandlePasteCommits),
Description: gui.Tr.SLocalize("pasteCommits"),
},
{
@@ -868,6 +868,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Description: gui.Tr.SLocalize("newBranch"),
},
{
+ ViewName: "commits",
+ Contexts: []string{SUB_COMMITS_CONTEXT_KEY},
+ Key: gui.getKey("commits.cherryPickCopy"),
+ Handler: gui.wrappedHandler(gui.handleCopyCommit),
+ Description: gui.Tr.SLocalize("cherryPickCopy"),
+ },
+ {
ViewName: "stash",
Key: gui.getKey("universal.goInto"),
Handler: gui.wrappedHandler(gui.handleViewStashFiles),