about summary refs log tree commit diff stats
path: root/prototypes
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-06-05 15:36:02 -0700
committerKartik Agaram <vc@akkartik.com>2020-06-05 15:36:02 -0700
commit5b2dc00888d5e14bab8a1b06596b5ea8f8a29dd9 (patch)
treeb76ee58a7a58bb3201c6861d411426c50779c342 /prototypes
parentfbb9b0489321e5dca0ee91c355b5839e133def90 (diff)
downloadmu-5b2dc00888d5e14bab8a1b06596b5ea8f8a29dd9.tar.gz
6472
Diffstat (limited to 'prototypes')
-rw-r--r--prototypes/browse/20/screen-position-state.mu11
1 files changed, 10 insertions, 1 deletions
diff --git a/prototypes/browse/20/screen-position-state.mu b/prototypes/browse/20/screen-position-state.mu
index 2d2a675f..d1a7bdff 100644
--- a/prototypes/browse/20/screen-position-state.mu
+++ b/prototypes/browse/20/screen-position-state.mu
@@ -37,7 +37,7 @@ fn init-screen-position-state _self: (addr screen-position-state) {
   copy-to *dest, 5  # left-margin
   # self->rightcol = self->leftcol + text-width
   dest <- get self, rightcol
-  copy-to *dest, 0xa  # left-margin + text-width
+  copy-to *dest, 0x45  # left-margin + text-width
   #
   start-drawing self
 }
@@ -61,7 +61,15 @@ fn start-drawing _self: (addr screen-position-state) {
 }
 
 fn add-char _self: (addr screen-position-state), c: byte {
+$add-char:body: {
   var self/esi: (addr screen-position-state) <- copy _self
+  {
+    compare c, 0xa  # newline
+    break-if-!=
+    next-line self
+    reposition-cursor self
+    break $add-char:body
+  }
   # print c
   print-byte c
   # self->col++
@@ -77,6 +85,7 @@ fn add-char _self: (addr screen-position-state), c: byte {
     reposition-cursor self
   }
 }
+}
 
 fn next-line _self: (addr screen-position-state) {
   var self/esi: (addr screen-position-state) <- copy _self