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:
@ -33,7 +33,7 @@ func (self *DiffingMenuAction) Call() error {
|
||||
{
|
||||
Label: self.c.Tr.EnterRefToDiff,
|
||||
OnPress: func() error {
|
||||
return self.c.Prompt(types.PromptOpts{
|
||||
self.c.Prompt(types.PromptOpts{
|
||||
Title: self.c.Tr.EnterRefName,
|
||||
FindSuggestionsFunc: self.c.Helpers().Suggestions.GetRefsSuggestionsFunc(),
|
||||
HandleConfirm: func(response string) error {
|
||||
@ -41,6 +41,8 @@ func (self *DiffingMenuAction) Call() error {
|
||||
return self.c.Refresh(types.RefreshOptions{Mode: types.ASYNC})
|
||||
},
|
||||
})
|
||||
|
||||
return nil
|
||||
},
|
||||
},
|
||||
}...)
|
||||
|
Reference in New Issue
Block a user