mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 20:36:03 +02:00
better confirmation panel messages
This commit is contained in:
parent
5fd3d11789
commit
4a483c112e
4 changed files with 9 additions and 4 deletions
|
@ -16,7 +16,7 @@ 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 (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 {
|
if output, err := gitCheckout(branch.Name, true); err != nil {
|
||||||
createErrorPanel(g, output)
|
createErrorPanel(g, output)
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ func renderBranchesOptions(g *gocui.Gui) error {
|
||||||
"f": "force checkout",
|
"f": "force checkout",
|
||||||
"m": "merge",
|
"m": "merge",
|
||||||
"c": "checkout by name",
|
"c": "checkout by name",
|
||||||
|
"n": "checkout new branch",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ func refreshCommits(g *gocui.Gui) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleResetToCommit(g *gocui.Gui, commitView *gocui.View) 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)
|
commit, err := getSelectedCommit(g)
|
||||||
devLog(commit)
|
devLog(commit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -74,7 +74,7 @@ func handleFileRemove(g *gocui.Gui, v *gocui.View) error {
|
||||||
} else {
|
} else {
|
||||||
deleteVerb = "delete"
|
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 {
|
if err := removeFile(file); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,10 @@ func handleSublimeFileOpen(g *gocui.Gui, v *gocui.View) error {
|
||||||
return genericFileOpen(g, v, sublimeOpenFile)
|
return genericFileOpen(g, v, sublimeOpenFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handleRefreshFiles(g *gocui.Gui, v *gocui.View) error {
|
||||||
|
return refreshFiles(g)
|
||||||
|
}
|
||||||
|
|
||||||
func refreshStateGitFiles() {
|
func refreshStateGitFiles() {
|
||||||
// get files to stage
|
// get files to stage
|
||||||
gitFiles := getGitStatusFiles()
|
gitFiles := getGitStatusFiles()
|
||||||
|
|
|
@ -63,7 +63,7 @@ func handleStashPop(g *gocui.Gui, v *gocui.View) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleStashDrop(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")
|
return stashDo(g, v, "drop")
|
||||||
}, nil)
|
}, nil)
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue