1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-04-23 12:18:51 +02:00

add navigate option to every panels options

This commit is contained in:
Jesse Duffield 2018-07-29 10:40:54 +10:00
parent 8b0db89edb
commit 5c271b8a70
3 changed files with 21 additions and 18 deletions

View File

@ -19,13 +19,13 @@ func handleBranchPress(g *gocui.Gui, v *gocui.View) error {
} }
func handleForceCheckout(g *gocui.Gui, v *gocui.View) error { func handleForceCheckout(g *gocui.Gui, v *gocui.View) error {
branch := getSelectedBranch(v) 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 { 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 { if output, err := gitCheckout(branch.Name, true); err != nil {
createErrorPanel(g, output) createErrorPanel(g, output)
} }
return refreshSidePanels(g) return refreshSidePanels(g)
}, nil) }, nil)
} }
func handleCheckoutByName(g *gocui.Gui, v *gocui.View) error { 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 { func renderBranchesOptions(g *gocui.Gui) error {
return renderOptionsMap(g, map[string]string{ return renderOptionsMap(g, map[string]string{
"space": "checkout", "space": "checkout",
"f": "force checkout", "f": "force checkout",
"m": "merge", "m": "merge",
"c": "checkout by name", "c": "checkout by name",
"n": "new branch", "n": "new branch",
"← → ↑ ↓": "navigate",
}) })
} }

View File

@ -62,9 +62,10 @@ func handleResetToCommit(g *gocui.Gui, commitView *gocui.View) error {
func renderCommitsOptions(g *gocui.Gui) error { func renderCommitsOptions(g *gocui.Gui) error {
return renderOptionsMap(g, map[string]string{ return renderOptionsMap(g, map[string]string{
"s": "squash down", "s": "squash down",
"r": "rename", "r": "rename",
"g": "reset to this commit", "g": "reset to this commit",
"← → ↑ ↓": "navigate",
}) })
} }

View File

@ -32,9 +32,10 @@ func getSelectedStashEntry(v *gocui.View) *StashEntry {
func renderStashOptions(g *gocui.Gui) error { func renderStashOptions(g *gocui.Gui) error {
return renderOptionsMap(g, map[string]string{ return renderOptionsMap(g, map[string]string{
"space": "apply", "space": "apply",
"k": "pop", "k": "pop",
"d": "drop", "d": "drop",
"← → ↑ ↓": "navigate",
}) })
} }