Skip to content

Commit 33bb89c

Browse files
committed
make sure input is displayed in repl history before evaluation blocks UI
1 parent 12abbe7 commit 33bb89c

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

app/src/main/java/replete/Main.kt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,16 @@ class MainActivity : AppCompatActivity() {
478478
inputField!!.text.clear()
479479
sendUIMessage(Messages.ADD_INPUT_ITEM, input)
480480

481-
try {
482-
if (isMacro(input)) {
483-
defmacroCalled(input)
484-
} else {
485-
eval(input)
481+
uiHandler!!.post {
482+
try {
483+
if (isMacro(input)) {
484+
defmacroCalled(input)
485+
} else {
486+
eval(input)
487+
}
488+
} catch (e: Exception) {
489+
sendUIMessage(Messages.ADD_ERROR_ITEM, e.toString())
486490
}
487-
} catch (e: Exception) {
488-
sendUIMessage(Messages.ADD_ERROR_ITEM, e.toString())
489491
}
490492

491493
}

0 commit comments

Comments
 (0)