about summary refs log tree commit diff stats
path: root/baremetal
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-02-25 21:31:39 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-02-25 21:31:39 -0800
commit03e8ad5dd9cf87ec83fd47fd9237a628f3ff8b06 (patch)
tree294cea90fa755ba03fe14388a2edf35fe02e297c /baremetal
parent7eb815210849f02b52f8c803851341f39aa570db (diff)
downloadmu-03e8ad5dd9cf87ec83fd47fd9237a628f3ff8b06.tar.gz
7803
Diffstat (limited to 'baremetal')
-rw-r--r--baremetal/shell/trace.mu237
1 files changed, 118 insertions, 119 deletions
diff --git a/baremetal/shell/trace.mu b/baremetal/shell/trace.mu
index 231fa2c4..1a689b47 100644
--- a/baremetal/shell/trace.mu
+++ b/baremetal/shell/trace.mu
@@ -486,7 +486,7 @@ fn edit-trace _self: (addr trace), key: grapheme {
     decrement *cursor-y
     return
   }
-  # enter
+  # enter = expand
   {
     compare key, 0xa/newline
     break-if-!=
@@ -505,7 +505,6 @@ fn expand _self: (addr trace) {
   var cursor-line-offset/eax: (offset trace-line) <- compute-offset trace, cursor-line-index
   var cursor-line/edx: (addr trace-line) <- index trace, cursor-line-offset
   var cursor-line-visible?/eax: (addr boolean) <- get cursor-line, visible?
-  compare *cursor-line-visible?, 0/false
   var cursor-line-depth/ebx: (addr int) <- get cursor-line, depth
   var target-depth/ebx: int <- copy *cursor-line-depth
   # if cursor-line is already visible, increment target-depth
@@ -657,7 +656,7 @@ fn test-cursor-down-past-bottom-of-trace {
   check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||   ", "F - test-cursor-down-past-bottom-of-trace/up-2/cursor"
 }
 
-fn test-cursor-expand-within-trace {
+fn test-expand-within-trace {
   var t-storage: trace
   var t/esi: (addr trace) <- address t-storage
   initialize-trace t, 0x10, 0x10
@@ -671,23 +670,23 @@ fn test-cursor-expand-within-trace {
   #
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "...         ", "F - test-cursor-expand-within-trace/pre-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||         ", "F - test-cursor-expand-within-trace/pre-0/cursor"
-  check-screen-row screen,                                  1/y, "            ", "F - test-cursor-expand-within-trace/pre-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-cursor-expand-within-trace/pre-1/cursor"
+  check-screen-row screen,                                  0/y, "...         ", "F - test-expand-within-trace/pre-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||         ", "F - test-expand-within-trace/pre-0/cursor"
+  check-screen-row screen,                                  1/y, "            ", "F - test-expand-within-trace/pre-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-expand-within-trace/pre-1/cursor"
   # expand
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1 ", "F - test-cursor-expand-within-trace/expand-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||| ", "F - test-cursor-expand-within-trace/expand-0/cursor"
-  check-screen-row screen,                                  1/y, "0 l: line 2 ", "F - test-cursor-expand-within-trace/expand-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-cursor-expand-within-trace/expand-1/cursor"
-  check-screen-row screen,                                  2/y, "            ", "F - test-cursor-expand-within-trace/expand-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "            ", "F - test-cursor-expand-within-trace/expand-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1 ", "F - test-expand-within-trace/expand-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||| ", "F - test-expand-within-trace/expand-0/cursor"
+  check-screen-row screen,                                  1/y, "0 l: line 2 ", "F - test-expand-within-trace/expand-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-expand-within-trace/expand-1/cursor"
+  check-screen-row screen,                                  2/y, "            ", "F - test-expand-within-trace/expand-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "            ", "F - test-expand-within-trace/expand-2/cursor"
 }
 
-fn test-cursor-expand-skips-lower-depth {
+fn test-trace-expand-skips-lower-depth {
   var t-storage: trace
   var t/esi: (addr trace) <- address t-storage
   initialize-trace t, 0x10, 0x10
@@ -702,23 +701,23 @@ fn test-cursor-expand-skips-lower-depth {
   #
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "...         ", "F - test-cursor-expand-skips-lower-depth/pre-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||         ", "F - test-cursor-expand-skips-lower-depth/pre-0/cursor"
-  check-screen-row screen,                                  1/y, "            ", "F - test-cursor-expand-skips-lower-depth/pre-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-cursor-expand-skips-lower-depth/pre-1/cursor"
+  check-screen-row screen,                                  0/y, "...         ", "F - test-trace-expand-skips-lower-depth/pre-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||         ", "F - test-trace-expand-skips-lower-depth/pre-0/cursor"
+  check-screen-row screen,                                  1/y, "            ", "F - test-trace-expand-skips-lower-depth/pre-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-trace-expand-skips-lower-depth/pre-1/cursor"
   # expand
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1 ", "F - test-cursor-expand-skips-lower-depth/expand-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||| ", "F - test-cursor-expand-skips-lower-depth/expand-0/cursor"
-  check-screen-row screen,                                  1/y, "...         ", "F - test-cursor-expand-skips-lower-depth/expand-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-cursor-expand-skips-lower-depth/expand-1/cursor"
-  check-screen-row screen,                                  2/y, "            ", "F - test-cursor-expand-skips-lower-depth/expand-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "            ", "F - test-cursor-expand-skips-lower-depth/expand-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1 ", "F - test-trace-expand-skips-lower-depth/expand-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||| ", "F - test-trace-expand-skips-lower-depth/expand-0/cursor"
+  check-screen-row screen,                                  1/y, "...         ", "F - test-trace-expand-skips-lower-depth/expand-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-trace-expand-skips-lower-depth/expand-1/cursor"
+  check-screen-row screen,                                  2/y, "            ", "F - test-trace-expand-skips-lower-depth/expand-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "            ", "F - test-trace-expand-skips-lower-depth/expand-2/cursor"
 }
 
-fn test-cursor-expand-continues-past-lower-depth {
+fn test-trace-expand-continues-past-lower-depth {
   var t-storage: trace
   var t/esi: (addr trace) <- address t-storage
   initialize-trace t, 0x10, 0x10
@@ -735,24 +734,24 @@ fn test-cursor-expand-continues-past-lower-depth {
   #
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "...         ", "F - test-cursor-expand-continues-past-lower-depth/pre-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||         ", "F - test-cursor-expand-continues-past-lower-depth/pre-0/cursor"
-  check-screen-row screen,                                  1/y, "            ", "F - test-cursor-expand-continues-past-lower-depth/pre-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-cursor-expand-continues-past-lower-depth/pre-1/cursor"
+  check-screen-row screen,                                  0/y, "...         ", "F - test-trace-expand-continues-past-lower-depth/pre-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||         ", "F - test-trace-expand-continues-past-lower-depth/pre-0/cursor"
+  check-screen-row screen,                                  1/y, "            ", "F - test-trace-expand-continues-past-lower-depth/pre-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-trace-expand-continues-past-lower-depth/pre-1/cursor"
   # expand
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1 ", "F - test-cursor-expand-continues-past-lower-depth/expand-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||| ", "F - test-cursor-expand-continues-past-lower-depth/expand-0/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1 ", "F - test-trace-expand-continues-past-lower-depth/expand-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||| ", "F - test-trace-expand-continues-past-lower-depth/expand-0/cursor"
   # TODO: might be too wasteful to show every place where lines are hidden
-  check-screen-row screen,                                  1/y, "...         ", "F - test-cursor-expand-continues-past-lower-depth/expand-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-cursor-expand-continues-past-lower-depth/expand-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 2 ", "F - test-cursor-expand-continues-past-lower-depth/expand-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "            ", "F - test-cursor-expand-continues-past-lower-depth/expand-2/cursor"
+  check-screen-row screen,                                  1/y, "...         ", "F - test-trace-expand-continues-past-lower-depth/expand-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "            ", "F - test-trace-expand-continues-past-lower-depth/expand-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 2 ", "F - test-trace-expand-continues-past-lower-depth/expand-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "            ", "F - test-trace-expand-continues-past-lower-depth/expand-2/cursor"
 }
 
-fn test-cursor-expand-stops-at-higher-depth {
+fn test-trace-expand-stops-at-higher-depth {
   var t-storage: trace
   var t/esi: (addr trace) <- address t-storage
   initialize-trace t, 0x10, 0x10
@@ -773,27 +772,27 @@ fn test-cursor-expand-stops-at-higher-depth {
   #
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "...           ", "F - test-cursor-expand-continues-past-lower-depth/pre-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-cursor-expand-continues-past-lower-depth/pre-0/cursor"
-  check-screen-row screen,                                  1/y, "              ", "F - test-cursor-expand-continues-past-lower-depth/pre-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-expand-continues-past-lower-depth/pre-1/cursor"
+  check-screen-row screen,                                  0/y, "...           ", "F - test-trace-expand-stops-at-higher-depth/pre-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-trace-expand-stops-at-higher-depth/pre-0/cursor"
+  check-screen-row screen,                                  1/y, "              ", "F - test-trace-expand-stops-at-higher-depth/pre-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-expand-stops-at-higher-depth/pre-1/cursor"
   # expand
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 8/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1.1 ", "F - test-cursor-expand-continues-past-lower-depth/expand-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||||| ", "F - test-cursor-expand-continues-past-lower-depth/expand-0/cursor"
-  check-screen-row screen,                                  1/y, "...           ", "F - test-cursor-expand-continues-past-lower-depth/expand-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-expand-continues-past-lower-depth/expand-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 1.2 ", "F - test-cursor-expand-continues-past-lower-depth/expand-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-cursor-expand-continues-past-lower-depth/expand-2/cursor"
-  check-screen-row screen,                                  3/y, "...           ", "F - test-cursor-expand-continues-past-lower-depth/expand-3"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, "              ", "F - test-cursor-expand-continues-past-lower-depth/expand-3/cursor"
-  check-screen-row screen,                                  4/y, "              ", "F - test-cursor-expand-continues-past-lower-depth/expand-4"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, "              ", "F - test-cursor-expand-continues-past-lower-depth/expand-4/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1.1 ", "F - test-trace-expand-stops-at-higher-depth/expand-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "||||||||||||| ", "F - test-trace-expand-stops-at-higher-depth/expand-0/cursor"
+  check-screen-row screen,                                  1/y, "...           ", "F - test-trace-expand-stops-at-higher-depth/expand-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-expand-stops-at-higher-depth/expand-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 1.2 ", "F - test-trace-expand-stops-at-higher-depth/expand-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-trace-expand-stops-at-higher-depth/expand-2/cursor"
+  check-screen-row screen,                                  3/y, "...           ", "F - test-trace-expand-stops-at-higher-depth/expand-3"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 3/y, "              ", "F - test-trace-expand-stops-at-higher-depth/expand-3/cursor"
+  check-screen-row screen,                                  4/y, "              ", "F - test-trace-expand-stops-at-higher-depth/expand-4"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 4/y, "              ", "F - test-trace-expand-stops-at-higher-depth/expand-4/cursor"
 }
 
-fn test-cursor-expand-twice {
+fn test-trace-expand-twice {
   var t-storage: trace
   var t/esi: (addr trace) <- address t-storage
   initialize-trace t, 0x10, 0x10
@@ -810,44 +809,44 @@ fn test-cursor-expand-twice {
   #
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "...           ", "F - test-cursor-expand-twice/pre-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-cursor-expand-twice/pre-0/cursor"
-  check-screen-row screen,                                  1/y, "              ", "F - test-cursor-expand-twice/pre-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-expand-twice/pre-1/cursor"
+  check-screen-row screen,                                  0/y, "...           ", "F - test-trace-expand-twice/pre-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-trace-expand-twice/pre-0/cursor"
+  check-screen-row screen,                                  1/y, "              ", "F - test-trace-expand-twice/pre-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-expand-twice/pre-1/cursor"
   # expand
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-expand-twice/expand-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||||   ", "F - test-cursor-expand-twice/expand-0/cursor"
-  check-screen-row screen,                                  1/y, "...           ", "F - test-cursor-expand-twice/expand-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-expand-twice/expand-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 2   ", "F - test-cursor-expand-twice/expand-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-cursor-expand-twice/expand-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-expand-twice/expand-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||||   ", "F - test-trace-expand-twice/expand-0/cursor"
+  check-screen-row screen,                                  1/y, "...           ", "F - test-trace-expand-twice/expand-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-expand-twice/expand-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 2   ", "F - test-trace-expand-twice/expand-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-trace-expand-twice/expand-2/cursor"
   # cursor down
   edit-trace t, 4/ctrl-d
   # hack: we need to render here to make this test pass; we're mixing state management with rendering
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-expand-twice/down-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-cursor-expand-twice/down-0/cursor"
-  check-screen-row screen,                                  1/y, "...           ", "F - test-cursor-expand-twice/down-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||           ", "F - test-cursor-expand-twice/down-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 2   ", "F - test-cursor-expand-twice/down-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-cursor-expand-twice/down-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-expand-twice/down-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-trace-expand-twice/down-0/cursor"
+  check-screen-row screen,                                  1/y, "...           ", "F - test-trace-expand-twice/down-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "|||           ", "F - test-trace-expand-twice/down-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 2   ", "F - test-trace-expand-twice/down-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-trace-expand-twice/down-2/cursor"
   # expand again
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-expand-twice/expand2-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-cursor-expand-twice/expand2-0/cursor"
-  check-screen-row screen,                                  1/y, "1 l: line 1.1 ", "F - test-cursor-expand-twice/expand2-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||||||||||||| ", "F - test-cursor-expand-twice/expand2-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 2   ", "F - test-cursor-expand-twice/expand2-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-cursor-expand-twice/expand2-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-expand-twice/expand2-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-trace-expand-twice/expand2-0/cursor"
+  check-screen-row screen,                                  1/y, "1 l: line 1.1 ", "F - test-trace-expand-twice/expand2-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "||||||||||||| ", "F - test-trace-expand-twice/expand2-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 2   ", "F - test-trace-expand-twice/expand2-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-trace-expand-twice/expand2-2/cursor"
 }
 
-fn test-cursor-refresh-cursor {
+fn test-trace-refresh-cursor {
   var t-storage: trace
   var t/esi: (addr trace) <- address t-storage
   initialize-trace t, 0x10, 0x10
@@ -862,31 +861,31 @@ fn test-cursor-refresh-cursor {
   #
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "...           ", "F - test-cursor-refresh-cursor/pre-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-cursor-refresh-cursor/pre-0/cursor"
-  check-screen-row screen,                                  1/y, "              ", "F - test-cursor-refresh-cursor/pre-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-refresh-cursor/pre-1/cursor"
+  check-screen-row screen,                                  0/y, "...           ", "F - test-trace-refresh-cursor/pre-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-trace-refresh-cursor/pre-0/cursor"
+  check-screen-row screen,                                  1/y, "              ", "F - test-trace-refresh-cursor/pre-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-refresh-cursor/pre-1/cursor"
   # expand
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-refresh-cursor/expand-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||||   ", "F - test-cursor-refresh-cursor/expand-0/cursor"
-  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-cursor-refresh-cursor/expand-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-refresh-cursor/expand-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-cursor-refresh-cursor/expand-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-cursor-refresh-cursor/expand-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-refresh-cursor/expand-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||||   ", "F - test-trace-refresh-cursor/expand-0/cursor"
+  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-trace-refresh-cursor/expand-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-refresh-cursor/expand-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-trace-refresh-cursor/expand-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-trace-refresh-cursor/expand-2/cursor"
   # cursor down
   edit-trace t, 4/ctrl-d
   edit-trace t, 4/ctrl-d
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-refresh-cursor/down-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-cursor-refresh-cursor/down-0/cursor"
-  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-cursor-refresh-cursor/down-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-refresh-cursor/down-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-cursor-refresh-cursor/down-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-cursor-refresh-cursor/down-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-refresh-cursor/down-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-trace-refresh-cursor/down-0/cursor"
+  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-trace-refresh-cursor/down-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-refresh-cursor/down-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-trace-refresh-cursor/down-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-trace-refresh-cursor/down-2/cursor"
   # recreate trace
   clear-trace t
   trace-text t, "l", "line 1"
@@ -894,15 +893,15 @@ fn test-cursor-refresh-cursor {
   trace-text t, "l", "line 3"
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   # cursor remains unchanged
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-refresh-cursor/refresh-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-cursor-refresh-cursor/refresh-0/cursor"
-  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-cursor-refresh-cursor/refresh-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-refresh-cursor/refresh-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-cursor-refresh-cursor/refresh-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-cursor-refresh-cursor/refresh-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-refresh-cursor/refresh-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-trace-refresh-cursor/refresh-0/cursor"
+  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-trace-refresh-cursor/refresh-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-refresh-cursor/refresh-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-trace-refresh-cursor/refresh-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-trace-refresh-cursor/refresh-2/cursor"
 }
 
-fn test-cursor-preserve-cursor-on-edit-in-other-line {
+fn test-trace-preserve-cursor-on-refresh {
   var t-storage: trace
   var t/esi: (addr trace) <- address t-storage
   initialize-trace t, 0x10, 0x10
@@ -917,31 +916,31 @@ fn test-cursor-preserve-cursor-on-edit-in-other-line {
   #
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "...           ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/pre-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/pre-0/cursor"
-  check-screen-row screen,                                  1/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/pre-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/pre-1/cursor"
+  check-screen-row screen,                                  0/y, "...           ", "F - test-trace-preserve-cursor-on-refresh/pre-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||           ", "F - test-trace-preserve-cursor-on-refresh/pre-0/cursor"
+  check-screen-row screen,                                  1/y, "              ", "F - test-trace-preserve-cursor-on-refresh/pre-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-preserve-cursor-on-refresh/pre-1/cursor"
   # expand
   edit-trace t, 0xa/enter
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/expand-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||||   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/expand-0/cursor"
-  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/expand-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/expand-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/expand-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/expand-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-preserve-cursor-on-refresh/expand-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "|||||||||||   ", "F - test-trace-preserve-cursor-on-refresh/expand-0/cursor"
+  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-trace-preserve-cursor-on-refresh/expand-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-preserve-cursor-on-refresh/expand-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-trace-preserve-cursor-on-refresh/expand-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "              ", "F - test-trace-preserve-cursor-on-refresh/expand-2/cursor"
   # cursor down
   edit-trace t, 4/ctrl-d
   edit-trace t, 4/ctrl-d
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   #
-  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/down-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/down-0/cursor"
-  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/down-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/down-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/down-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/down-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 1   ", "F - test-trace-preserve-cursor-on-refresh/down-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-trace-preserve-cursor-on-refresh/down-0/cursor"
+  check-screen-row screen,                                  1/y, "0 l: line 2   ", "F - test-trace-preserve-cursor-on-refresh/down-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-preserve-cursor-on-refresh/down-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-trace-preserve-cursor-on-refresh/down-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-trace-preserve-cursor-on-refresh/down-2/cursor"
   # recreate trace with slightly different lines
   clear-trace t
   trace-text t, "l", "line 4"
@@ -949,10 +948,10 @@ fn test-cursor-preserve-cursor-on-edit-in-other-line {
   trace-text t, "l", "line 3"  # cursor line is unchanged
   var y/ecx: int <- render-trace screen, t, 0/xmin, 0/ymin, 0x10/xmax, 4/ymax, 1/show-cursor
   # cursor remains unchanged
-  check-screen-row screen,                                  0/y, "0 l: line 4   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/refresh-0"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/refresh-0/cursor"
-  check-screen-row screen,                                  1/y, "0 l: line 5   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/refresh-1"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/refresh-1/cursor"
-  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/refresh-2"
-  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-cursor-preserve-cursor-on-edit-in-other-line/refresh-2/cursor"
+  check-screen-row screen,                                  0/y, "0 l: line 4   ", "F - test-trace-preserve-cursor-on-refresh/refresh-0"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 0/y, "              ", "F - test-trace-preserve-cursor-on-refresh/refresh-0/cursor"
+  check-screen-row screen,                                  1/y, "0 l: line 5   ", "F - test-trace-preserve-cursor-on-refresh/refresh-1"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 1/y, "              ", "F - test-trace-preserve-cursor-on-refresh/refresh-1/cursor"
+  check-screen-row screen,                                  2/y, "0 l: line 3   ", "F - test-trace-preserve-cursor-on-refresh/refresh-2"
+  check-background-color-in-screen-row screen, 7/bg=cursor, 2/y, "|||||||||||   ", "F - test-trace-preserve-cursor-on-refresh/refresh-2/cursor"
 }
47' href='#n247'>247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715