about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-11 22:59:00 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-11 23:00:45 -0700
commit5668acaf442e52c3ae07766ba901702db2df97a2 (patch)
tree6c604b8c278c48a5b01941b7110c0e778a44185e
parente6c19a3465c751b8794ae1dd97b8c98e39b9f18e (diff)
downloadmu-5668acaf442e52c3ae07766ba901702db2df97a2.tar.gz
7007 - tile: hotkey to clear sandbox
Alternative symbols considered for the menu option:
  ∅
  AC (like in a calculator)
-rw-r--r--apps/tile/environment.mu16
1 files changed, 16 insertions, 0 deletions
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 *"