about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--trace.arc.t26
-rw-r--r--trace.mu8
2 files changed, 27 insertions, 7 deletions
diff --git a/trace.arc.t b/trace.arc.t
index c5141099..d516c8bc 100644
--- a/trace.arc.t
+++ b/trace.arc.t
@@ -572,10 +572,22 @@ run: main 7: n")
             "+ main/ 1 : d e f"
             "                 "))
   (prn "F - expanding doesn't print past end of page"))
+(run-code main2-2
+  (replace-character 2:terminal-address/raw ((#\* literal)))
+  )
+; screen shows part of the second trace line expanded
+(when (~screen-contains memory*.4 17
+         (+ "* main/ 0 : a b c"
+            "   mem : 0 a     "
+            "+ main/ 1 : d e f"
+            "                 "))
+  (prn "F - cursor at right place after expand"))
 
 ; expand line below without first collapsing previously expanded line
 (run-code main3
   (default-space:space-address <- new space:literal 30:literal/capacity)
+  ; reset previous cursor
+  (replace-character 2:terminal-address/raw ((#\- literal)))
   (s:string-address <- new "j\n")
   (k:keyboard-address <- init-keyboard s:string-address)
   (process-key 3:space-address/raw/browser-state k:keyboard-address 2:terminal-address/raw)
@@ -592,10 +604,23 @@ run: main 7: n")
             "                 "
             "                 "))
   (prn "F - expanding below expanded line respects screen/page height"))
+(run-code main3-2
+  (replace-character 2:terminal-address/raw ((#\* literal)))
+  )
+; screen shows part of the second trace line expanded
+(when (~screen-contains memory*.4 17
+         (+ "+ main/ 0 : a b c"
+            "* main/ 1 : d e f"
+            "   mem : 1 a     "
+            "                 "
+            "                 "))
+  (prn "F - cursor at right place after expand below"))
 
 ; expand line *above* without first collapsing previously expanded line
 (run-code main4
   (default-space:space-address <- new space:literal 30:literal/capacity)
+  ; reset previous cursor
+  (replace-character 2:terminal-address/raw ((#\- literal)))
   (s:string-address <- new "k\n")
   (k:keyboard-address <- init-keyboard s:string-address)
   (process-key 3:space-address/raw/browser-state k:keyboard-address 2:terminal-address/raw)
@@ -611,6 +636,7 @@ run: main 7: n")
             "+ main/ 1 : d e f"
             "                 "))
   (prn "F - expanding above expanded line respects screen/page height"))
+;? (quit) ;? 1
 
 ; collapse everything and hit page-down
 ; again, we can't yet check for special keys like 'page-down so we'll use
diff --git a/trace.mu b/trace.mu
index b2365d66..1626a7eb 100644
--- a/trace.mu
+++ b/trace.mu
@@ -707,13 +707,7 @@
           (loop)
         }
         ; print traces collapsed until just before original row
-        { begin
-          (done?:boolean <- greater-or-equal cursor-row:integer/space:1 original-trace-index:integer)
-          (break-if done?:boolean)
-          (tr:instruction-trace-address <- index traces:instruction-trace-address-array-address/space:1/deref cursor-row:integer/space:1)
-          (print-instruction-trace-collapsed screen:terminal-address tr:instruction-trace-address 0:space-address/browser-state)
-          (loop)
-        }
+        (print-traces-collapsed-from 0:space-address/browser-state screen:terminal-address cursor-row:integer/space:1 original-trace-index:integer/until)
         ; fall through
       }
     }