about summary refs log tree commit diff stats
path: root/edit.mu
diff options
context:
space:
mode:
Diffstat (limited to 'edit.mu')
-rw-r--r--edit.mu18
1 files changed, 15 insertions, 3 deletions
diff --git a/edit.mu b/edit.mu
index b8087a5a..9b8b0c49 100644
--- a/edit.mu
+++ b/edit.mu
@@ -2333,8 +2333,8 @@ container programming-environment-data [
   recipes:address:editor-data
   recipe-warnings:address:array:character
   current-sandbox:address:editor-data
-  sandbox:address:sandbox-data
-  sandbox-in-focus?:boolean  # false => focus in recipes; true => focus in current-sandbox
+  sandbox:address:sandbox-data  # list of sandboxes, from top to bottom
+  sandbox-in-focus?:boolean  # false => cursor in recipes; true => cursor in current-sandbox
 ]
 
 recipe new-programming-environment [
@@ -2610,6 +2610,7 @@ recipe event-loop [
     {
       t:address:touch-event <- maybe-convert e:event, touch:variant
       break-unless t
+#?       $print [touch 0], 10/newline #? 1
       # ignore all but 'left-click' events for now
       # todo: test this
       touch-type:number <- get *t, type:offset
@@ -2618,6 +2619,7 @@ recipe event-loop [
       # later exceptions for non-editor touches will go here
       +global-touch
       # send to both editors
+#?       $print [sending touch to editors], 10/newline #? 1
       _ <- move-cursor-in-editor screen, recipes, *t
       *sandbox-in-focus? <- move-cursor-in-editor screen, current-sandbox, *t
       render-minimal screen, env
@@ -2674,7 +2676,11 @@ container sandbox-data [
   data:address:array:character
   response:address:array:character
   warnings:address:array:character
-  starting-row-on-screen:number  # to track clicks on delete
+#?   foo:number
+#?   expected-response:address:array:character
+  # coordinates to track clicks
+  starting-row-on-screen:number
+  response-starting-row-on-screen:number
   screen:address:screen  # prints in the sandbox go here
   next-sandbox:address:sandbox-data
 ]
@@ -3229,18 +3235,24 @@ recipe foo [
 after +global-touch [
   # right side of screen and below sandbox editor? pop appropriate sandbox
   # contents back into sandbox editor provided it's empty
+#?   $print [touch 1], 10/newline #? 1
   {
     sandbox-left-margin:number <- get *current-sandbox, left:offset
     click-column:number <- get *t, column:offset
     on-sandbox-side?:boolean <- greater-or-equal click-column, sandbox-left-margin
     break-unless on-sandbox-side?
     first-sandbox:address:sandbox-data <- get *env, sandbox:offset
+    break-unless first-sandbox
     first-sandbox-begins:number <- get *first-sandbox, starting-row-on-screen:offset
+#?     $print first-sandbox-begins, 10/newline #? 1
     click-row:number <- get *t, row:offset
+#?     $print [click row ], click-row, 10/newline #? 1
     below-sandbox-editor?:boolean <- greater-or-equal click-row, first-sandbox-begins
     break-unless below-sandbox-editor?
+#?     $print [below sandbox editor], 10/newline #? 1
     empty-sandbox-editor?:boolean <- empty-editor? current-sandbox
     break-unless empty-sandbox-editor?  # make the user hit F4 before editing a new sandbox
+#?     $print [on sandbox], 10/newline #? 1
     # identify the sandbox to edit and remove it from the sandbox list
     sandbox:address:sandbox-data <- extract-sandbox env, click-row
     text:address:array:character <- get *sandbox, data:offset