about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--shell/gap-buffer.mu8
1 files changed, 8 insertions, 0 deletions
diff --git a/shell/gap-buffer.mu b/shell/gap-buffer.mu
index 6486b6ea..893dc176 100644
--- a/shell/gap-buffer.mu
+++ b/shell/gap-buffer.mu
@@ -971,6 +971,14 @@ fn edit-gap-buffer self: (addr gap-buffer), key: grapheme {
     clear-gap-buffer self
     return
   }
+  {
+    compare g, 9/tab
+    break-if-!=
+    # tab = 2 spaces
+    add-code-point-at-gap self, 0x20/space
+    add-code-point-at-gap self, 0x20/space
+    return
+  }
   # default: insert character
   add-grapheme-at-gap self, g
 }