mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02: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:
parent
5396a70661
commit
1869fda800
12 changed files with 30 additions and 44 deletions
|
@ -958,13 +958,8 @@ func (gui *Gui) onUIThread(f func() error) {
|
|||
})
|
||||
}
|
||||
|
||||
func (gui *Gui) onWorker(f func(t gocui.Task)) {
|
||||
gui.g.OnWorker(func(t gocui.Task) error {
|
||||
// Hack: adapt to the changed signature in the simplest possible way.
|
||||
// We'll make this cleaner in subsequent commits in this branch.
|
||||
f(t)
|
||||
return nil
|
||||
})
|
||||
func (gui *Gui) onWorker(f func(gocui.Task) error) {
|
||||
gui.g.OnWorker(f)
|
||||
}
|
||||
|
||||
func (gui *Gui) getWindowDimensions(informationStr string, appStatus string) map[string]boxlayout.Dimensions {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue