diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-06-04 19:58:20 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-06-04 19:58:20 -0700 |
commit | 81b3f72fb8a0f822723945f5f7afd6c59d384110 (patch) | |
tree | 5790967237bf780189b72542739124611bc1233c | |
parent | eb6758c61f0eb98a19e72a7113126688fcc984ff (diff) | |
download | mu-81b3f72fb8a0f822723945f5f7afd6c59d384110.tar.gz |
.
-rw-r--r-- | shell/environment.mu | 2 | ||||
-rw-r--r-- | shell/global.mu | 2 | ||||
-rw-r--r-- | shell/main.mu | 1 | ||||
-rw-r--r-- | shell/sandbox.mu | 15 |
4 files changed, 10 insertions, 10 deletions
diff --git a/shell/environment.mu b/shell/environment.mu index 16c7804a..4ba57ca5 100644 --- a/shell/environment.mu +++ b/shell/environment.mu @@ -32,7 +32,7 @@ fn render-environment screen: (addr screen), _self: (addr environment) { render-globals-menu screen, globals } -fn edit-environment _self: (addr environment), key: byte, data-disk: (addr disk) { +fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr disk) { var self/esi: (addr environment) <- copy _self var globals/edi: (addr global-table) <- get self, globals var sandbox/ecx: (addr sandbox) <- get self, sandbox diff --git a/shell/global.mu b/shell/global.mu index 8e3aecce..c2b600e7 100644 --- a/shell/global.mu +++ b/shell/global.mu @@ -184,7 +184,7 @@ fn render-globals screen: (addr screen), _self: (addr global-table) { fn render-globals-menu screen: (addr screen), _self: (addr global-table) { } -fn edit-globals _self: (addr global-table), key: byte, data-disk: (addr disk) { +fn edit-globals _self: (addr global-table), key: grapheme, data-disk: (addr disk) { } fn assign-or-create-global _self: (addr global-table), name: (addr array byte), value: (handle cell), trace: (addr trace) { diff --git a/shell/main.mu b/shell/main.mu index 8da0be6c..93b8d08c 100644 --- a/shell/main.mu +++ b/shell/main.mu @@ -13,6 +13,7 @@ fn main screen: (addr screen), keyboard: (addr keyboard), data-disk: (addr disk) var key/eax: byte <- read-key keyboard compare key, 0 loop-if-= + var key/eax: grapheme <- copy key edit-environment env, key, data-disk } loop diff --git a/shell/sandbox.mu b/shell/sandbox.mu index 83be593c..51ce1442 100644 --- a/shell/sandbox.mu +++ b/shell/sandbox.mu @@ -460,12 +460,11 @@ fn render-keyboard-menu screen: (addr screen) { draw-text-rightward-from-cursor screen, " to sandbox ", width, 7/fg, 0xc5/bg=blue-bg } -fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), data-disk: (addr disk), tweak-real-screen?: boolean { +fn edit-sandbox _self: (addr sandbox), key: grapheme, globals: (addr global-table), data-disk: (addr disk), tweak-real-screen?: boolean { var self/esi: (addr sandbox) <- copy _self - var g/edx: grapheme <- copy key # ctrl-s { - compare g, 0x13/ctrl-s + compare key, 0x13/ctrl-s break-if-!= # if cursor is in trace, skip var cursor-in-trace?/eax: (addr boolean) <- get self, cursor-in-trace? @@ -480,7 +479,7 @@ fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), } # ctrl-m { - compare g, 0xd/ctrl-m + compare key, 0xd/ctrl-m break-if-!= # if cursor in data, switch to trace or fall through to keyboard { @@ -544,7 +543,7 @@ fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), break-if-= var data-ah/eax: (addr handle gap-buffer) <- get self, data var data/eax: (addr gap-buffer) <- lookup *data-ah - edit-gap-buffer data, g + edit-gap-buffer data, key return } # if cursor in keyboard, send key to keyboard @@ -567,7 +566,7 @@ fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), } var keyboard-ah/eax: (addr handle gap-buffer) <- get keyboard-cell, keyboard-data var keyboard/eax: (addr gap-buffer) <- lookup *keyboard-ah - edit-gap-buffer keyboard, g + edit-gap-buffer keyboard, key return } # if cursor in trace, send key to trace @@ -579,7 +578,7 @@ fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), var trace/eax: (addr trace) <- lookup *trace-ah # if expanding the trace, first check if we need to run the sandbox again with a deeper trace { - compare g, 0xa/newline + compare key, 0xa/newline break-if-!= { var need-rerun?/eax: boolean <- cursor-too-deep? trace @@ -600,7 +599,7 @@ fn edit-sandbox _self: (addr sandbox), key: byte, globals: (addr global-table), var save-addr/ecx: (addr trace-index-stash) <- address save restore-indices trace, save-addr } - edit-trace trace, g + edit-trace trace, key return } } |