mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Make OnWorker callback return an error
This lets us get rid of a few more calls to Error(), and it simplifies things for clients of OnWorker: they can simply return an error from their callback like we do everywhere else.
This commit is contained in:
@ -180,7 +180,7 @@ func (self *FilesController) Explode(v *gocui.View, onDone func()) {
|
||||
style.FgBlack.SetBold(),
|
||||
}
|
||||
|
||||
self.c.OnWorker(func(_ gocui.Task) {
|
||||
self.c.OnWorker(func(_ gocui.Task) error {
|
||||
max := 25
|
||||
for i := 0; i < max; i++ {
|
||||
image := getExplodeImage(width, height, i, max)
|
||||
@ -198,6 +198,7 @@ func (self *FilesController) Explode(v *gocui.View, onDone func()) {
|
||||
onDone()
|
||||
return nil
|
||||
})
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user