From 1010b50bb86da505f8002dd142cec0a37b13b8a2 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 14 Feb 2021 14:41:35 -0800 Subject: 7742 - baremetal/shell is alive --- baremetal/shell/line.mu | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'baremetal') 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 -- cgit 1.4.1-2-gfad0