From 4a483c112e2de057a5fa475c9726fa069f773d66 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 10 Jun 2018 11:52:30 +1000 Subject: [PATCH] better confirmation panel messages --- branches_panel.go | 3 ++- commits_panel.go | 2 +- files_panel.go | 6 +++++- stash_panel.go | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/branches_panel.go b/branches_panel.go index 4060b670a..12f2394a6 100644 --- a/branches_panel.go +++ b/branches_panel.go @@ -16,7 +16,7 @@ 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 (y/n)", 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 { createErrorPanel(g, output) } @@ -70,6 +70,7 @@ func renderBranchesOptions(g *gocui.Gui) error { "f": "force checkout", "m": "merge", "c": "checkout by name", + "n": "checkout new branch", }) } diff --git a/commits_panel.go b/commits_panel.go index 05ca7eac5..a1930cba2 100644 --- a/commits_panel.go +++ b/commits_panel.go @@ -40,7 +40,7 @@ func refreshCommits(g *gocui.Gui) error { } func handleResetToCommit(g *gocui.Gui, commitView *gocui.View) error { - return createConfirmationPanel(g, commitView, "Reset To Commit", "Are you sure you want to reset to this commit? (y/n)", func(g *gocui.Gui, v *gocui.View) error { + return createConfirmationPanel(g, commitView, "Reset To Commit", "Are you sure you want to reset to this commit?", func(g *gocui.Gui, v *gocui.View) error { commit, err := getSelectedCommit(g) devLog(commit) if err != nil { diff --git a/files_panel.go b/files_panel.go index 8e718da7f..cb15e8b3b 100644 --- a/files_panel.go +++ b/files_panel.go @@ -74,7 +74,7 @@ func handleFileRemove(g *gocui.Gui, v *gocui.View) error { } else { deleteVerb = "delete" } - return createConfirmationPanel(g, v, strings.Title(deleteVerb)+" file", "Are you sure you want to "+deleteVerb+" "+file.Name+" (you will lose your changes)? (y/n)", func(g *gocui.Gui, v *gocui.View) error { + return createConfirmationPanel(g, v, strings.Title(deleteVerb)+" file", "Are you sure you want to "+deleteVerb+" "+file.Name+" (you will lose your changes)?", func(g *gocui.Gui, v *gocui.View) error { if err := removeFile(file); err != nil { panic(err) } @@ -172,6 +172,10 @@ func handleSublimeFileOpen(g *gocui.Gui, v *gocui.View) error { return genericFileOpen(g, v, sublimeOpenFile) } +func handleRefreshFiles(g *gocui.Gui, v *gocui.View) error { + return refreshFiles(g) +} + func refreshStateGitFiles() { // get files to stage gitFiles := getGitStatusFiles() diff --git a/stash_panel.go b/stash_panel.go index 5b39793c2..beec8648c 100644 --- a/stash_panel.go +++ b/stash_panel.go @@ -63,7 +63,7 @@ func handleStashPop(g *gocui.Gui, v *gocui.View) error { } func handleStashDrop(g *gocui.Gui, v *gocui.View) error { - return createConfirmationPanel(g, v, "Stash drop", "Are you sure you want to drop this stash entry? (y/n)", func(g *gocui.Gui, v *gocui.View) error { + return createConfirmationPanel(g, v, "Stash drop", "Are you sure you want to drop this stash entry?", func(g *gocui.Gui, v *gocui.View) error { return stashDo(g, v, "drop") }, nil) return nil