about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-04-05 22:39:37 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-04-05 22:39:37 -0700
commit4861c39474965eeb69b34b63a99e09c812c5fefc (patch)
tree21a12eee27235230aa5aff839145ab82ab107c1d
parent143cce94eea904ef025c94238fe3541b87ad694e (diff)
downloadmu-4861c39474965eeb69b34b63a99e09c812c5fefc.tar.gz
shell: ctrl-a/e
-rw-r--r--shell/gap-buffer.mu12
1 files changed, 12 insertions, 0 deletions
diff --git a/shell/gap-buffer.mu b/shell/gap-buffer.mu
index 616500b0..394ec358 100644
--- a/shell/gap-buffer.mu
+++ b/shell/gap-buffer.mu
@@ -771,6 +771,18 @@ fn edit-gap-buffer self: (addr gap-buffer), key: grapheme {
     var dummy/eax: grapheme <- gap-right self
     return
   }
+  {
+    compare g, 1/ctrl-a
+    break-if-!=
+    gap-to-start self
+    return
+  }
+  {
+    compare g, 5/ctrl-e
+    break-if-!=
+    gap-to-end self
+    return
+  }
   # default: insert character
   add-grapheme-at-gap self, g
 }