From a8561da2f619aebae96669718a6d5274dedc2b6e Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 30 Jul 2015 15:50:49 -0700 Subject: 1895 - starting to impose some architecture on edit.mu --- edit.mu | 27 ++++++++++++++++----------- 1 file 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 -- cgit 1.4.1-2-gfad0