about summary refs log tree commit diff stats
path: root/apps/tile/word.mu
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tile/word.mu')
-rw-r--r--apps/tile/word.mu6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/tile/word.mu b/apps/tile/word.mu
index 4c7b13dd..cbc3c90d 100644
--- a/apps/tile/word.mu
+++ b/apps/tile/word.mu
@@ -134,6 +134,12 @@ fn cursor-to-end _self: (addr word) {
   gap-to-end data
 }
 
+fn cursor-index _self: (addr word) -> result/eax: int {
+  var self/esi: (addr word) <- copy _self
+  var data/eax: (addr gap-buffer) <- get self, data
+  result <- gap-index data
+}
+
 fn print-word screen: (addr screen), _self: (addr word) {
   var self/esi: (addr word) <- copy _self
   var data/eax: (addr gap-buffer) <- get self, data