mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-15 00:15:32 +02:00
Remove return value of Alert/Confirm/Prompt
This might seem controversial; in many cases the client code gets longer, because it needs an extra line for an explicit `return nil`. I still prefer this, because it makes it clearer which calls can return errors.
This commit is contained in:
@ -201,10 +201,10 @@ func (self *BisectController) openStartBisectMenu(info *git_commands.BisectInfo,
|
||||
{
|
||||
Label: self.c.Tr.Bisect.ChooseTerms,
|
||||
OnPress: func() error {
|
||||
return self.c.Prompt(types.PromptOpts{
|
||||
self.c.Prompt(types.PromptOpts{
|
||||
Title: self.c.Tr.Bisect.OldTermPrompt,
|
||||
HandleConfirm: func(oldTerm string) error {
|
||||
return self.c.Prompt(types.PromptOpts{
|
||||
self.c.Prompt(types.PromptOpts{
|
||||
Title: self.c.Tr.Bisect.NewTermPrompt,
|
||||
HandleConfirm: func(newTerm string) error {
|
||||
self.c.LogAction(self.c.Tr.Actions.StartBisect)
|
||||
@ -215,8 +215,10 @@ func (self *BisectController) openStartBisectMenu(info *git_commands.BisectInfo,
|
||||
return self.c.Helpers().Bisect.PostBisectCommandRefresh()
|
||||
},
|
||||
})
|
||||
return nil
|
||||
},
|
||||
})
|
||||
return nil
|
||||
},
|
||||
Key: 't',
|
||||
},
|
||||
@ -235,7 +237,7 @@ func (self *BisectController) showBisectCompleteMessage(candidateHashes []string
|
||||
return err
|
||||
}
|
||||
|
||||
return self.c.Confirm(types.ConfirmOpts{
|
||||
self.c.Confirm(types.ConfirmOpts{
|
||||
Title: self.c.Tr.Bisect.CompleteTitle,
|
||||
Prompt: fmt.Sprintf(prompt, strings.TrimSpace(formattedCommits)),
|
||||
HandleConfirm: func() error {
|
||||
@ -247,6 +249,8 @@ func (self *BisectController) showBisectCompleteMessage(candidateHashes []string
|
||||
return self.c.Helpers().Bisect.PostBisectCommandRefresh()
|
||||
},
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (self *BisectController) afterMark(selectCurrent bool, waitToReselect bool) error {
|
||||
|
Reference in New Issue
Block a user