diff options
-rw-r--r-- | 020run.cc | 18 | ||||
-rw-r--r-- | edit.mu | 8 |
2 files changed, 22 insertions, 4 deletions
diff --git a/020run.cc b/020run.cc index 08aa2b74..5f1e15c1 100644 --- a/020run.cc +++ b/020run.cc @@ -131,18 +131,28 @@ if (argc > 1) { :(before "End Main") if (!Run_tests) { setup(); -//? Trace_file = "interactive"; //? 1 -//? START_TRACING_UNTIL_END_OF_SCOPE; -//? Trace_stream->dump_layer = "all"; //? 2 +//? Trace_file = "interactive"; //? 2 +//? START_TRACING_UNTIL_END_OF_SCOPE; //? 2 +//? Trace_stream->collect_layer = "app"; //? 1 transform_all(); recipe_ordinal r = Recipe_ordinal[string("main")]; -//? Trace_stream->dump_layer = "all"; //? 1 if (r) run(r); //? dump_memory(); //? 1 teardown(); } :(code) +void cleanup_main() { + if (!Trace_file.empty()) { + ofstream fout(Trace_file.c_str()); + fout << Trace_stream->readable_contents(""); + fout.close(); + } +} +:(before "End One-time Setup") +atexit(cleanup_main); + +:(code) void load_permanently(string filename) { ifstream fin(filename.c_str()); fin.peek(); diff --git a/edit.mu b/edit.mu index a5c2795b..ce405fa5 100644 --- a/edit.mu +++ b/edit.mu @@ -666,12 +666,19 @@ recipe event-loop [ { t:address:touch-event <- maybe-convert e:event, touch:variant break-unless t:address:touch-event + # ignore 'release' events for now + # todo: test this + touch-type:number <- get t:address:touch-event/deref, type:offset + is-release?:boolean <- equal touch-type:number, 65510:literal/mouse-release + loop-if is-release?:boolean, +next-event:label # on a sandbox delete icon? process delete { was-delete?:boolean <- delete-sandbox t:address:touch-event/deref, env:address:programming-environment-data break-unless was-delete?:boolean +#? trace [app], [delete clicked] #? 1 screen:address <- render-sandbox-side screen:address, env:address:programming-environment-data, 1:literal/clear update-cursor screen:address, recipes:address:editor-data, current-sandbox:address:editor-data, sandbox-in-focus?:address:boolean/deref + show-screen screen:address loop +next-event:label } # if not, send to both editors @@ -2869,6 +2876,7 @@ recipe render-sandbox-side [ screen:address <- next-ingredient env:address:programming-environment-data <- next-ingredient clear:boolean <- next-ingredient +#? trace [app], [render sandbox side] #? 1 current-sandbox:address:editor-data <- get env:address:programming-environment-data/deref, current-sandbox:offset left:number <- get current-sandbox:address:editor-data/deref, left:offset right:number <- get current-sandbox:address:editor-data/deref, right:offset |