summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Manuel Tomás <jtomas1815@gmail.com>2020-05-08 00:03:29 -0300
committerJuan Manuel Tomás <jtomas1815@gmail.com>2020-05-08 00:03:29 -0300
commit137f5f6bbe935e71ca66bb9aafd0114aaab654f0 (patch)
treec2e9f089d8e844733567a8d5763452f53748b615
parent6fcf9534df7881d7d9822a85dba62b4efc6d9007 (diff)
downloadjet-137f5f6bbe935e71ca66bb9aafd0114aaab654f0.tar.gz
jet-137f5f6bbe935e71ca66bb9aafd0114aaab654f0.zip
Add quit key binding
-rw-r--r--jet.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/jet.c b/jet.c
index 294b822..712269e 100644
--- a/jet.c
+++ b/jet.c
@@ -37,7 +37,8 @@ int main(int argc, char *argv[]) {
int mode = NORMAL_MODE;
- while (1) {
+ int quit = 0;
+ while (!quit) {
clear();
int x = -1, y = -1;
@@ -57,6 +58,9 @@ int main(int argc, char *argv[]) {
if (mode == NORMAL_MODE) {
switch (input) {
+ case '':
+ quit = 1;
+ break;
case 'i':
mode = INSERT_MODE;
break;