about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--edit.mu36
1 files changed, 28 insertions, 8 deletions
diff --git a/edit.mu b/edit.mu
index b34a8389..8886b835 100644
--- a/edit.mu
+++ b/edit.mu
@@ -4447,7 +4447,9 @@ after +global-keypress [
   {
     do-run?:boolean <- equal *k, 65532/F4
     break-unless do-run?
-    run-sandboxes env
+    status:address:array:character <- new [running...  ]
+    screen <- update-status screen, status, 245/grey
+    run-sandboxes env, screen
     # F4 might update warnings and results on both sides
     screen <- render-all screen, env
     update-cursor screen, recipes, current-sandbox, *sandbox-in-focus?
@@ -4458,6 +4460,7 @@ after +global-keypress [
 recipe run-sandboxes [
   local-scope
   env:address:programming-environment-data <- next-ingredient
+  screen:address <- next-ingredient
   recipes:address:editor-data <- get *env, recipes:offset
   # copy code from recipe editor, persist, load into mu, save any warnings
   in:address:array:character <- editor-contents recipes
@@ -4465,7 +4468,12 @@ recipe run-sandboxes [
   recipe-warnings:address:address:array:character <- get-address *env, recipe-warnings:offset
   *recipe-warnings <- reload in
   # if recipe editor has errors, stop
-  reply-if *recipe-warnings
+  {
+    break-unless *recipe-warnings
+    status:address:array:character <- new [errors found]
+    update-status screen, status, 1/red
+    reply
+  }
   # check contents of right editor (sandbox)
   current-sandbox:address:editor-data <- get *env, current-sandbox:offset
   {
@@ -4502,6 +4510,18 @@ recipe run-sandboxes [
     curr <- get *curr, next-sandbox:offset
     loop
   }
+  status:address:array:character <- new [            ]
+  screen <- update-status screen, status, 245/grey
+]
+
+recipe update-status [
+  local-scope
+  screen:address <- next-ingredient
+  msg:address:array:character <- next-ingredient
+  color:number <- next-ingredient
+  move-cursor screen, 0, 2
+  screen <- print-string screen, msg, color, 238/grey/background
+  reply screen/same-as-ingredient:0
 ]
 
 recipe save-sandboxes [
@@ -5555,7 +5575,7 @@ recipe foo [
     event-loop screen:address, console:address, env:address:programming-environment-data
   ]
   screen-should-contain [
-    .                                                                                 run (F4)           .
+    .  errors found                                                                   run (F4)           .
     .                                                  ┊foo                                              .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .  get 123:number, foo:offset                      ┊                                                 .
@@ -5565,7 +5585,7 @@ recipe foo [
     .                                                  ┊                                                 .
   ]
   screen-should-contain-in-color 1/red, [
-    .                                                                                                    .
+    .  errors found                                                                                      .
     .                                                                                                    .
     .                                                                                                    .
     .                                                                                                    .
@@ -5591,7 +5611,7 @@ recipe foo [
     event-loop screen:address, console:address, env:address:programming-environment-data
   ]
   screen-should-contain [
-    .                                                                                 run (F4)           .
+    .  errors found                                                                   run (F4)           .
     .                                                  ┊foo                                              .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .  x <- copy 0                                     ┊                                                 .
@@ -5649,7 +5669,7 @@ recipe foo [
     event-loop screen:address, console:address, env:address:programming-environment-data
   ]
   screen-should-contain [
-    .                                                                                 run (F4)           .
+    .  errors found                                                                   run (F4)           .
     .                                                  ┊foo                                              .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .  x:number <- copy 0                              ┊                                                 .
@@ -5680,7 +5700,7 @@ recipe foo [
     event-loop screen:address, console:address, 3:address:programming-environment-data
   ]
   screen-should-contain [
-    .                                                                                 run (F4)           .
+    .  errors found                                                                   run (F4)           .
     .                                                  ┊foo                                              .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .  x:number <- copy y:number                       ┊                                                 .
@@ -5697,7 +5717,7 @@ recipe foo [
     event-loop screen:address, console:address, 3:address:programming-environment-data
   ]
   screen-should-contain [
-    .                                                                                 run (F4)           .
+    .  errors found                                                                   run (F4)           .
     .                                                  ┊foo                                              .
     .recipe foo [                                      ┊━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.
     .  x:number <- copy y:number                       ┊                                                 .
ref='#n358'>358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473