diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-11-06 10:13:43 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-11-06 10:13:43 -0700 |
commit | 29bb6403ebd4b9bc17fa4832c10720508b6d6324 (patch) | |
tree | 6d28df10217be90e786c94893dcdc903b706ba51 /src | |
parent | e0c0dea5b708549ff440d451e0c8c0aaae620331 (diff) | |
download | teliva-29bb6403ebd4b9bc17fa4832c10720508b6d6324.tar.gz |
exit editor with ctrl-x for consistency
Diffstat (limited to 'src')
-rw-r--r-- | src/kilo.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/kilo.c b/src/kilo.c index 5af4ac0..cac99ef 100644 --- a/src/kilo.c +++ b/src/kilo.c @@ -122,6 +122,7 @@ enum KEY_ACTION{ CTRL_Q = 17, CTRL_S = 19, CTRL_U = 21, + CTRL_X = 24, ESC = 27, BACKSPACE = 127, /* The following are just soft codes, not really reported by the @@ -1169,11 +1170,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_Q: + case CTRL_X: /* Quit if the file was already saved. */ if (E.dirty && quit_times) { editorSetStatusMessage("WARNING!!! File has unsaved changes. " - "Press Ctrl-Q %d more times to quit.", quit_times); + "Press Ctrl-X %d more times to quit.", quit_times); quit_times--; return; } @@ -1263,7 +1264,7 @@ void edit(char* filename) { editorOpen(filename); enableRawMode(STDIN_FILENO); editorSetStatusMessage( - "HELP: Ctrl-S = save | Ctrl-Q = quit | Ctrl-F = find"); + "HELP: Ctrl-S = save | Ctrl-X = quit | Ctrl-F = find"); while(!Quit) { editorRefreshScreen(); editorProcessKeypress(STDIN_FILENO); |