about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-02-14 14:41:35 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-02-14 14:41:35 -0800
commit1010b50bb86da505f8002dd142cec0a37b13b8a2 (patch)
treecddb0d8fa05f13b744ed1313c7e2665958f836ea
parent4961a020b47d89a09ed5cbcf51ddac2b3e8bfcc2 (diff)
downloadmu-1010b50bb86da505f8002dd142cec0a37b13b8a2.tar.gz
7742 - baremetal/shell is alive
-rw-r--r--baremetal/shell/line.mu11
1 files changed, 10 insertions, 1 deletions
diff --git a/baremetal/shell/line.mu b/baremetal/shell/line.mu
index 67901ffa..ff5cf519 100644
--- a/baremetal/shell/line.mu
+++ b/baremetal/shell/line.mu
@@ -113,6 +113,7 @@ fn render-line-with-stack screen: (addr screen), _line: (addr line), x: int, y:
       break-if-<=
       new-y <- copy curr-y
     }
+    new-x <- add 1/inter-word-spacing
     # update
     var next-word-ah/eax: (addr handle word) <- get curr-word, next
     var next-word/eax: (addr word) <- lookup *next-word-ah
@@ -169,9 +170,17 @@ fn test-render-line-with-stack-singleton {
 
 fn edit-line _self: (addr line), key: byte {
   var self/esi: (addr line) <- copy _self
-  var cursor-word-ah/eax: (addr handle word) <- get self, cursor
+  var cursor-word-ah/edx: (addr handle word) <- get self, cursor
   var _cursor-word/eax: (addr word) <- lookup *cursor-word-ah
   var cursor-word/ecx: (addr word) <- copy _cursor-word
+  compare key, 0x20/space
+  $edit-line:space: {
+    break-if-!=
+    append-word cursor-word-ah
+    var next-word-ah/eax: (addr handle word) <- get cursor-word, next
+    copy-object next-word-ah, cursor-word-ah
+    return
+  }
   # otherwise insert key within current word
   var g/edx: grapheme <- copy key
   add-grapheme-to-word cursor-word, g
>153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219