mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-08 23:56:15 +02:00
Extract the inner part of WithWaitingStatus as a synchronous variant of it
This is the same as WithWaitingStatus but without the implicit OnWorker, for those who are on a background thread already.
This commit is contained in:
parent
d2723ff2dd
commit
e48e7a2ebc
@ -60,10 +60,14 @@ func (self appStatusHelperTask) Continue() {
|
|||||||
// withWaitingStatus wraps a function and shows a waiting status while the function is still executing
|
// withWaitingStatus wraps a function and shows a waiting status while the function is still executing
|
||||||
func (self *AppStatusHelper) WithWaitingStatus(message string, f func(gocui.Task) error) {
|
func (self *AppStatusHelper) WithWaitingStatus(message string, f func(gocui.Task) error) {
|
||||||
self.c.OnWorker(func(task gocui.Task) error {
|
self.c.OnWorker(func(task gocui.Task) error {
|
||||||
|
return self.WithWaitingStatusImpl(message, f, task)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func (self *AppStatusHelper) WithWaitingStatusImpl(message string, f func(gocui.Task) error, task gocui.Task) error {
|
||||||
return self.statusMgr().WithWaitingStatus(message, self.renderAppStatus, func(waitingStatusHandle *status.WaitingStatusHandle) error {
|
return self.statusMgr().WithWaitingStatus(message, self.renderAppStatus, func(waitingStatusHandle *status.WaitingStatusHandle) error {
|
||||||
return f(appStatusHelperTask{task, waitingStatusHandle})
|
return f(appStatusHelperTask{task, waitingStatusHandle})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *AppStatusHelper) WithWaitingStatusSync(message string, f func() error) error {
|
func (self *AppStatusHelper) WithWaitingStatusSync(message string, f func() error) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user