about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-06 10:18:22 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-11-06 10:18:22 -0700
commit0de8ee3911f40eff2289caaccaa182ad6d990908 (patch)
tree51927052781b4bd37203fc5d017720bd0f83e83b
parent29bb6403ebd4b9bc17fa4832c10720508b6d6324 (diff)
downloadteliva-0de8ee3911f40eff2289caaccaa182ad6d990908.tar.gz
no, more consistent to toggle run/edit with ctrl-e
-rw-r--r--src/kilo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kilo.c b/src/kilo.c
index cac99ef..ce377fe 100644
--- a/src/kilo.c
+++ b/src/kilo.c
@@ -114,6 +114,7 @@ enum KEY_ACTION{
         KEY_NULL = 0,
         CTRL_C = 3,
         CTRL_D = 4,
+        CTRL_E = 5,
         CTRL_F = 6,
         CTRL_H = 8,
         TAB = 9,
@@ -1170,11 +1171,11 @@ void editorProcessKeypress(int fd) {
         /* We ignore ctrl-c, it can't be so simple to lose the changes
          * to the edited file. */
         break;
-    case CTRL_X:
+    case CTRL_E:
         /* Quit if the file was already saved. */
         if (E.dirty && quit_times) {
             editorSetStatusMessage("WARNING!!! File has unsaved changes. "
-                "Press Ctrl-X %d more times to quit.", quit_times);
+                "Press Ctrl-E %d more times to quit.", quit_times);
             quit_times--;
             return;
         }
@@ -1264,7 +1265,7 @@ void edit(char* filename) {
     editorOpen(filename);
     enableRawMode(STDIN_FILENO);
     editorSetStatusMessage(
-        "HELP: Ctrl-S = save | Ctrl-X = quit | Ctrl-F = find");
+        "HELP: Ctrl-S = save | Ctrl-E = quit | Ctrl-F = find");
     while(!Quit) {
         editorRefreshScreen();
         editorProcessKeypress(STDIN_FILENO);