From 5c271b8a70a323700d693edf8c20e11eb43cd310 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 29 Jul 2018 10:40:54 +1000 Subject: [PATCH] add navigate option to every panels options --- branches_panel.go | 25 +++++++++++++------------ commits_panel.go | 7 ++++--- stash_panel.go | 7 ++++--- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/branches_panel.go b/branches_panel.go index 8b84ee908..8a65719a4 100644 --- a/branches_panel.go +++ b/branches_panel.go @@ -19,13 +19,13 @@ func handleBranchPress(g *gocui.Gui, v *gocui.View) error { } func handleForceCheckout(g *gocui.Gui, v *gocui.View) error { - branch := getSelectedBranch(v) - return createConfirmationPanel(g, v, "Force Checkout Branch", "Are you sure you want force checkout? You will lose all local changes", func(g *gocui.Gui, v *gocui.View) error { - if output, err := gitCheckout(branch.Name, true); err != nil { - createErrorPanel(g, output) - } - return refreshSidePanels(g) - }, nil) + branch := getSelectedBranch(v) + return createConfirmationPanel(g, v, "Force Checkout Branch", "Are you sure you want force checkout? You will lose all local changes", func(g *gocui.Gui, v *gocui.View) error { + if output, err := gitCheckout(branch.Name, true); err != nil { + createErrorPanel(g, output) + } + return refreshSidePanels(g) + }, nil) } func handleCheckoutByName(g *gocui.Gui, v *gocui.View) error { @@ -70,11 +70,12 @@ func getSelectedBranch(v *gocui.View) Branch { func renderBranchesOptions(g *gocui.Gui) error { return renderOptionsMap(g, map[string]string{ - "space": "checkout", - "f": "force checkout", - "m": "merge", - "c": "checkout by name", - "n": "new branch", + "space": "checkout", + "f": "force checkout", + "m": "merge", + "c": "checkout by name", + "n": "new branch", + "← → ↑ ↓": "navigate", }) } diff --git a/commits_panel.go b/commits_panel.go index a1930cba2..767e49bcd 100644 --- a/commits_panel.go +++ b/commits_panel.go @@ -62,9 +62,10 @@ func handleResetToCommit(g *gocui.Gui, commitView *gocui.View) error { func renderCommitsOptions(g *gocui.Gui) error { return renderOptionsMap(g, map[string]string{ - "s": "squash down", - "r": "rename", - "g": "reset to this commit", + "s": "squash down", + "r": "rename", + "g": "reset to this commit", + "← → ↑ ↓": "navigate", }) } diff --git a/stash_panel.go b/stash_panel.go index 09b092fbb..9fe386ac7 100644 --- a/stash_panel.go +++ b/stash_panel.go @@ -32,9 +32,10 @@ func getSelectedStashEntry(v *gocui.View) *StashEntry { func renderStashOptions(g *gocui.Gui) error { return renderOptionsMap(g, map[string]string{ - "space": "apply", - "k": "pop", - "d": "drop", + "space": "apply", + "k": "pop", + "d": "drop", + "← → ↑ ↓": "navigate", }) }