diff options
author | Kartik Agaram <vc@akkartik.com> | 2020-09-19 22:47:03 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2020-09-19 22:47:21 -0700 |
commit | 1436f0298f4c6b9a141a4f23fb89f5c00e98175d (patch) | |
tree | afd8ff89fbd4c7b2250a4eb5c11cd6c049d031bf /apps/tile/environment.mu | |
parent | f32e575e387859af74f7023f9f02b32dee839962 (diff) | |
download | mu-1436f0298f4c6b9a141a4f23fb89f5c00e98175d.tar.gz |
6812 - tile: render cursor location
Diffstat (limited to 'apps/tile/environment.mu')
-rw-r--r-- | apps/tile/environment.mu | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu index c57c64e7..d589464c 100644 --- a/apps/tile/environment.mu +++ b/apps/tile/environment.mu @@ -137,7 +137,8 @@ fn render _env: (addr environment), max-depth: int { curr-word <- lookup *next-word-ah loop } - move-cursor screen, 3, *cursor-col-a # input-row + var col/eax: (addr int) <- copy cursor-col-a + move-cursor screen, 3, *col # input-row } # Render: @@ -181,8 +182,17 @@ fn render-column screen: (addr screen), first-word: (addr word), final-word: (ad # render word, initialize result move-cursor screen, 3, botleft-col # input-row print-word screen, final-word -#? var len/eax: int <- word-length final-word -#? right-col <- copy len + + # update cursor + { + var f/eax: (addr word) <- copy final-word + compare f, cursor-word + break-if-!= + var cursor-index/eax: int <- cursor-index cursor-word + cursor-index <- add botleft-col + var dest/edi: (addr int) <- copy cursor-col-a + copy-to *dest, cursor-index + } # post-process right-col right-col <- copy max-width |