1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-17 00:18:05 +02:00

use suspense rather than close the gui when switching to a subprocess

This commit is contained in:
Jesse Duffield
2021-04-02 21:30:39 +11:00
parent 0b42437052
commit 69e9f6d29d
9 changed files with 49 additions and 65 deletions

View File

@ -11,17 +11,13 @@ import (
// runSyncOrAsyncCommand takes the output of a command that may have returned
// either no error, an error, or a subprocess to execute, and if a subprocess
// needs to be set on the gui object, it does so, and then returns the error
// the bool returned tells us whether the calling code should continue
// needs to be run, it runs it
func (gui *Gui) runSyncOrAsyncCommand(sub *exec.Cmd, err error) (bool, error) {
if err != nil {
if err != gui.Errors.ErrSubProcess {
return false, gui.surfaceError(err)
}
return false, gui.surfaceError(err)
}
if sub != nil {
gui.SubProcess = sub
return false, gui.Errors.ErrSubProcess
return false, gui.runSubprocessWithSuspense(sub)
}
return true, nil
}