about summary refs log tree commit diff stats
path: root/shell
diff options
context:
space:
mode:
authorMax Bernstein <emacs@fb.com>2021-03-08 15:40:49 -0800
committerMax Bernstein <emacs@fb.com>2021-03-08 15:40:49 -0800
commit96e75f1070180c44aae6328f4c702ed00e7a813a (patch)
tree316db013ed6bafc8e5cda24da4f4ea430afdf612 /shell
parentde7713d97470528ee47031f64446d45555ee7a10 (diff)
downloadmu-96e75f1070180c44aae6328f4c702ed00e7a813a.tar.gz
Add j/k keybindings for navigating trace
These are familiar for Vim users.
Diffstat (limited to 'shell')
-rw-r--r--shell/trace.mu16
1 files changed, 16 insertions, 0 deletions
diff --git a/shell/trace.mu b/shell/trace.mu
index e3269088..b8e1e00d 100644
--- a/shell/trace.mu
+++ b/shell/trace.mu
@@ -690,6 +690,14 @@ fn edit-trace _self: (addr trace), key: grapheme {
     increment *cursor-y
     return
   }
+  # cursor down
+  {
+    compare key, 0x6a/j
+    break-if-!=
+    var cursor-y/eax: (addr int) <- get self, cursor-y
+    increment *cursor-y
+    return
+  }
   # cursor up
   {
     compare key, 0x15/ctrl-u
@@ -698,6 +706,14 @@ fn edit-trace _self: (addr trace), key: grapheme {
     decrement *cursor-y
     return
   }
+  # cursor up
+  {
+    compare key, 0x6b/k
+    break-if-!=
+    var cursor-y/eax: (addr int) <- get self, cursor-y
+    decrement *cursor-y
+    return
+  }
   # enter = expand
   {
     compare key, 0xa/newline