From 5b2dc00888d5e14bab8a1b06596b5ea8f8a29dd9 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Fri, 5 Jun 2020 15:36:02 -0700 Subject: 6472 --- prototypes/browse/20/screen-position-state.mu | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'prototypes/browse') 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 -- cgit 1.4.1-2-gfad0