about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--apps/browse/main.mu14
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/browse/main.mu b/apps/browse/main.mu
index 3736c1f4..3a397ee0 100644
--- a/apps/browse/main.mu
+++ b/apps/browse/main.mu
@@ -26,10 +26,12 @@ fn main args-on-stack: (addr array addr array byte) -> exit-status/ebx: int {
   }
 }
 
-fn interactive args: (addr array addr array byte) -> exit-status/ebx: int {
+fn interactive _args: (addr array addr array byte) -> exit-status/ebx: int {
 $interactive:body: {
   # initialize fs from args[1]
-  var filename/eax: (addr array byte) <- first-arg args
+  var args/eax: (addr array addr array byte) <- copy _args
+  var arg/eax: (addr addr array byte) <- index args, 1
+  var filename/eax: (addr array byte) <- copy *arg
   var file-storage: (handle buffered-file)
   var file-storage-addr/esi: (addr handle buffered-file) <- address file-storage
   open filename, 0, file-storage-addr
@@ -54,7 +56,7 @@ $interactive:body: {
   #
   {
     render paginated-screen, fs
-    var key/eax: byte <- read-key-from-real-keyboard
+    var key/eax: grapheme <- read-key-from-real-keyboard
     compare key, 0x71  # 'q'
     loop-if-!=
   }
@@ -395,12 +397,6 @@ fn render-until-underscore screen: (addr paginated-screen), fs: (addr buffered-f
   }
 }
 
-fn first-arg args-on-stack: (addr array addr array byte) -> out/eax: (addr array byte) {
-  var args/eax: (addr array addr array byte) <- copy args-on-stack
-  var result/eax: (addr addr array byte) <- index args, 1
-  out <- copy *result
-}
-
 fn normal-text screen: (addr paginated-screen) {
   reset-formatting-on-paginated-screen screen
   start-color-on-paginated-screen screen, 0xec, 7  # 236 = darkish gray