about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-30 15:50:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-30 16:00:18 -0700
commita8561da2f619aebae96669718a6d5274dedc2b6e (patch)
tree7a5c64ec279568df87b8449bd1be613679c3a9de
parent383d5bea814ab9bac9fc0f7b85abb607d4109cb3 (diff)
downloadmu-a8561da2f619aebae96669718a6d5274dedc2b6e.tar.gz
1895 - starting to impose some architecture on edit.mu
-rw-r--r--edit.mu27
1 files changed, 16 insertions, 11 deletions
diff --git a/edit.mu b/edit.mu
index 56454403..d94f1860 100644
--- a/edit.mu
+++ b/edit.mu
@@ -650,21 +650,12 @@ recipe event-loop [
     {
       k:address:number <- maybe-convert e:event, keycode:variant
       break-unless k
-      # F4? load all code and run all sandboxes.
-      {
-        do-run?:boolean <- equal *k, 65532/F4
-        break-unless do-run?
-        run-sandboxes env
-        # F4 might update warnings and results on both sides
-        screen <- render-all screen, env
-        update-cursor screen, recipes, current-sandbox, *sandbox-in-focus?
-        show-screen screen
-        loop +next-event:label
-      }
+      +global-keypress
     }
     {
       c:address:character <- maybe-convert e:event, text:variant
       break-unless c
+      +global-type
       # ctrl-n? - switch focus
       {
         ctrl-n?:boolean <- equal *c, 14/ctrl-n
@@ -2832,6 +2823,20 @@ scenario run-and-show-results [
   ]
 ]
 
+after +global-keypress [
+  # F4? load all code and run all sandboxes.
+  {
+    do-run?:boolean <- equal *k, 65532/F4
+    break-unless do-run?
+    run-sandboxes env
+    # F4 might update warnings and results on both sides
+    screen <- render-all screen, env
+    update-cursor screen, recipes, current-sandbox, *sandbox-in-focus?
+    show-screen screen
+    loop +next-event:label
+  }
+]
+
 recipe run-sandboxes [
   local-scope
   env:address:programming-environment-data <- next-ingredient