From 47821f1bddd6b5401b36e08043f28c6dd63e4ae4 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Thu, 17 Sep 2020 22:00:09 -0700 Subject: 6797 --- apps/tile/environment.mu | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu index c14d34af..3f96b8c8 100644 --- a/apps/tile/environment.mu +++ b/apps/tile/environment.mu @@ -71,30 +71,28 @@ $process:body: { compare key, 0x445b1b # left-arrow { break-if-!= - var foo/eax: grapheme <- gap-left buf - compare foo, -1 + var char-skipped/eax: grapheme <- gap-left buf + compare char-skipped, -1 { break-if-= -#? print-string-to-real-screen "XXX\n" - var cursor-col/eax: (addr int) <- get self, cursor-col + var cursor-row/eax: (addr int) <- get self, cursor-row + var cursor-col/ecx: (addr int) <- get self, cursor-col decrement *cursor-col -#? print-int32-decimal-to-real-screen *cursor-col -#? print-string-to-real-screen "ZZZ\n" + move-cursor screen, *cursor-row, *cursor-col } - var cursor-row/eax: (addr int) <- get self, cursor-row - var cursor-col/ecx: (addr int) <- get self, cursor-col - move-cursor screen, *cursor-row, *cursor-col break $process:body } compare key, 0x435b1b # right-arrow { break-if-!= - var foo/eax: grapheme <- gap-right buf - compare foo, -1 + var char-skipped/eax: grapheme <- gap-right buf + compare char-skipped, -1 { break-if-= - var cursor-col/eax: (addr int) <- get self, cursor-col + var cursor-row/eax: (addr int) <- get self, cursor-row + var cursor-col/ecx: (addr int) <- get self, cursor-col increment *cursor-col + move-cursor screen, *cursor-row, *cursor-col } break $process:body } -- cgit 1.4.1-2-gfad0