From 137f5f6bbe935e71ca66bb9aafd0114aaab654f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Fri, 8 May 2020 00:03:29 -0300 Subject: Add quit key binding --- jet.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3