about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-28 21:16:50 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-28 21:16:50 -0800
commit3203bf7afffe19128fe107afcae44791d817730b (patch)
treef48744501240ff672191b5b2bf359e0478890f61 /src
parentf6c2974cb449d4bc3eb41bd5ccc9e106ccbdb0e0 (diff)
downloadteliva-3203bf7afffe19128fe107afcae44791d817730b.tar.gz
tab key: always insert two spaces
Diffstat (limited to 'src')
-rw-r--r--src/kilo.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/kilo.c b/src/kilo.c
index 1c568d9..4b5e3dc 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -1145,6 +1145,11 @@ static void editorProcessKeypress(lua_State* L) {
     case ESC:
         /* Nothing to do for ESC in this mode. */
         break;
+    case TAB:
+        /* insert 2 spaces */
+        editorInsertChar(' ');
+        editorInsertChar(' ');
+        break;
     default:
         editorInsertChar(c);
         break;
5'>^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36