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/gap-buffer.mu | |
parent | f32e575e387859af74f7023f9f02b32dee839962 (diff) | |
download | mu-1436f0298f4c6b9a141a4f23fb89f5c00e98175d.tar.gz |
6812 - tile: render cursor location
Diffstat (limited to 'apps/tile/gap-buffer.mu')
-rw-r--r-- | apps/tile/gap-buffer.mu | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/tile/gap-buffer.mu b/apps/tile/gap-buffer.mu index 96e39aed..8a57fc5b 100644 --- a/apps/tile/gap-buffer.mu +++ b/apps/tile/gap-buffer.mu @@ -139,7 +139,6 @@ $gap-right:body: { } { var left/ecx: (addr grapheme-stack) <- get self, left - # HERE: can't use 'result' here: "unknown variable 'result'" push-grapheme-stack left, g } } @@ -163,6 +162,13 @@ $gap-left:body: { } } +fn gap-index _self: (addr gap-buffer) -> result/eax: int { + var self/eax: (addr gap-buffer) <- copy _self + var left/eax: (addr grapheme-stack) <- get self, left + var top-addr/eax: (addr int) <- get left, top + result <- copy *top-addr +} + fn gap-buffer-equal? _self: (addr gap-buffer), s: (addr array byte) -> result/eax: boolean { $gap-buffer-equal?:body: { var self/esi: (addr gap-buffer) <- copy _self |