about summary refs log tree commit diff stats
path: root/src/kilo.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-06 10:37:49 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-11-06 10:37:49 -0700
commit3e94073a889c65336ceb4d2e59c6ec5d93a04e49 (patch)
treeef8d93f3c56a6baeb93f7d3eb2c26f2dda516908 /src/kilo.c
parent38d202d68d2db9c8a41927e06940ef9c5da936d8 (diff)
downloadteliva-3e94073a889c65336ceb4d2e59c6ec5d93a04e49.tar.gz
auto-save
We'll add version control soon.
Diffstat (limited to 'src/kilo.c')
-rw-r--r--src/kilo.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/kilo.c b/src/kilo.c
index 310e509..1b321fc 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -1171,17 +1171,9 @@ void editorProcessKeypress(int fd) {
          * to the edited file. */
         break;
     case CTRL_E:
-        /* Quit if the file was already saved. */
-        if (E.dirty && quit_times) {
-            editorSetStatusMessage("WARNING!!! File has unsaved changes. "
-                "Press Ctrl-E %d more times to quit.", quit_times);
-            quit_times--;
-            return;
-        }
-        Quit = 1;
-        break;
-    case CTRL_S:
+        /* Save and quit. */
         editorSave();
+        Quit = 1;
         break;
     case CTRL_F:
         editorFind(fd);