about summary refs log tree commit diff stats
path: root/apps/browse/screen-position-state.mu
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-09-07 22:09:43 -0700
committerKartik Agaram <vc@akkartik.com>2020-09-07 22:14:54 -0700
commitfc42975cf429a75f15b079d9d0d216311b42f7a9 (patch)
treeae438e590828e62daddc47d1d18c5e8b5a189b77 /apps/browse/screen-position-state.mu
parent137cde5bfae7104c97b0f48277480eb78ced4ff1 (diff)
downloadmu-fc42975cf429a75f15b079d9d0d216311b42f7a9.tar.gz
6751
More copypasta. I'd be able to remove this duplication if we had first-class
functions, but they involve an accessibility cost.
Diffstat (limited to 'apps/browse/screen-position-state.mu')
-rw-r--r--apps/browse/screen-position-state.mu9
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/browse/screen-position-state.mu b/apps/browse/screen-position-state.mu
index 7b53ae07..f342faab 100644
--- a/apps/browse/screen-position-state.mu
+++ b/apps/browse/screen-position-state.mu
@@ -61,19 +61,18 @@ fn start-drawing _self: (addr screen-position-state) {
   reposition-cursor self
 }
 
-fn add-char _self: (addr screen-position-state), c: byte {
-$add-char:body: {
+fn add-grapheme _self: (addr screen-position-state), c: grapheme {
+$add-grapheme: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
+    break $add-grapheme:body
   }
   # print c
-  var g/eax: grapheme <- copy c
-  print-grapheme 0, g
+  print-grapheme 0, c
   # self->col++
   var tmp/eax: (addr int) <- get self, col
   increment *tmp