From 0a31edecb66c1b00051f9d601c589d737cc62505 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 3 Jan 2020 13:01:32 +0100 Subject: make Ctrl+P visible --- docs/keybindings/Keybindings_en.md | 1 + pkg/gui/keybindings.go | 16 ++++++++++------ pkg/i18n/english.go | 3 +++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index 1ad719251..e9c6faf59 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -4,6 +4,7 @@
   m: view merge/rebase options
+  ctrl+p: view custom patch options
   P: push
   p: pull
   R: refresh
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index ae0f8f8ad..8d036fc07 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -36,6 +36,9 @@ func (b *Binding) GetKey() string {
 		if b.Key.(gocui.Key) == gocui.KeyCtrlK {
 			return "ctrl+k"
 		}
+		if b.Key.(gocui.Key) == gocui.KeyCtrlP {
+			return "ctrl+p"
+		}
 		key = int(b.Key.(gocui.Key))
 	}
 
@@ -138,6 +141,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
 			Handler:     gui.handleCreateRebaseOptionsMenu,
 			Description: gui.Tr.SLocalize("ViewMergeRebaseOptions"),
 		},
+		{
+			ViewName:    "",
+			Key:         gocui.KeyCtrlP,
+			Modifier:    gocui.ModNone,
+			Handler:     gui.handleCreatePatchOptionsMenu,
+			Description: gui.Tr.SLocalize("ViewPatchOptions"),
+		},
 		{
 			ViewName:    "",
 			Key:         'P',
@@ -177,12 +187,6 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
 			Modifier: gocui.ModNone,
 			Handler:  gui.handleCreateOptionsMenu,
 		},
-		{
-			ViewName: "",
-			Key:      gocui.KeyCtrlP,
-			Modifier: gocui.ModNone,
-			Handler:  gui.handleCreatePatchOptionsMenu,
-		},
 		{
 			ViewName:    "status",
 			Key:         'e',
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index 849594872..55a607090 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -822,6 +822,9 @@ func addEnglish(i18nObject *i18n.Bundle) error {
 		}, &i18n.Message{
 			ID:    "toggleAddToPatch",
 			Other: "toggle file included in patch",
+		}, &i18n.Message{
+			ID:    "ViewPatchOptions",
+			Other: "view custom patch options",
 		}, &i18n.Message{
 			ID:    "PatchOptionsTitle",
 			Other: "Patch Options",
-- 
cgit v1.2.3