When yielding after an async command, call the rest deferred

This might help fix the crash bug?
This commit is contained in:
blinry 2020-11-09 19:37:26 +01:00
parent 38faac5485
commit a893cba9d3
2 changed files with 5 additions and 3 deletions

View file

@ -1,9 +1,9 @@
conflict
init init
checkout-commit checkout-commit
branching branching
merge merge
branches branches
conflict
pull-push pull-push
rebase rebase
reorder reorder

View file

@ -78,7 +78,9 @@ func send_command(command):
var cmd = repository.shell.run_async(command, false) var cmd = repository.shell.run_async(command, false)
yield(cmd, "done") yield(cmd, "done")
call_deferred("command_done", cmd)
func command_done(cmd):
if cmd.exit_code == 0: if cmd.exit_code == 0:
$OkSound.pitch_scale = rand_range(0.8, 1.2) $OkSound.pitch_scale = rand_range(0.8, 1.2)
$OkSound.play() $OkSound.play()
@ -89,7 +91,7 @@ func send_command(command):
input.editable = true input.editable = true
if cmd.output.length() <= 1000: if cmd.output.length() <= 1000:
output.text = output.text + "$ " + command + "\n" + cmd.output output.text = output.text + "$ " + cmd.command + "\n" + cmd.output
else: else:
$Pager/Text.text = cmd.output $Pager/Text.text = cmd.output
$Pager.popup() $Pager.popup()