From 5668acaf442e52c3ae07766ba901702db2df97a2 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sun, 11 Oct 2020 22:59:00 -0700 Subject: 7007 - tile: hotkey to clear sandbox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alternative symbols considered for the menu option: ∅ AC (like in a calculator) --- apps/tile/environment.mu | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu index 8bec7366..64a779f7 100644 --- a/apps/tile/environment.mu +++ b/apps/tile/environment.mu @@ -325,6 +325,18 @@ $process:body: { # so the final word is always guaranteed to be at the top-level break $process:body } + compare key, 0x15 # ctrl-u + $process:clear-line: { + break-if-!= + # clear line in sandbox + var cursor-call-path-ah/eax: (addr handle call-path-element) <- get sandbox, cursor-call-path + allocate cursor-call-path-ah + var line-ah/eax: (addr handle line) <- get sandbox, data + allocate line-ah + var line/eax: (addr line) <- lookup *line-ah + initialize-line line + break $process:body + } # if cursor is within a call, disable editing hotkeys below var cursor-call-path-ah/eax: (addr handle call-path-element) <- get sandbox, cursor-call-path var cursor-call-path/eax: (addr call-path-element) <- lookup *cursor-call-path-ah @@ -837,6 +849,10 @@ fn clear-canvas _env: (addr environment) { print-string screen, " ctrl-e " reset-formatting screen print-string screen, " ⏭ " + start-reverse-video screen + print-string screen, " ctrl-u " + reset-formatting screen + print-string screen, " clear line " # currently defined functions move-cursor screen, 3, 2 print-string screen, "x 2* = x 2 *" -- cgit 1.4.1-2-gfad0