From e220f4495356a982eb58e9cd67ebe4ce45e8f144 Mon Sep 17 00:00:00 2001 From: LouisJackman <11330428+LouisJackman@users.noreply.github.com> Date: Sat, 23 May 2020 08:36:40 +0100 Subject: [PATCH] Simplify and don't replace history for cancelled forms --- src/mainclient/shell.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/mainclient/shell.c b/src/mainclient/shell.c index cef773a4..37f5b137 100644 --- a/src/mainclient/shell.c +++ b/src/mainclient/shell.c @@ -63,8 +63,7 @@ Janet janet_line_getter(int32_t argc, Janet *argv) { gbl_cancel_current_repl_form = false; // Signal that the user bailed out of the current form - static const char *const msg = "cancel"; - result = janet_ckeywordv(msg); + result = janet_ckeywordv("cancel"); } else { result = janet_wrap_buffer(buf); } @@ -960,16 +959,12 @@ void janet_line_get(const char *p, JanetBuffer *buffer) { } if (line()) { norawmode(); - if (gbl_cancel_current_repl_form) { - fputc('\n', out); + if (gbl_sigint_flag) { + raise(SIGINT); } else { - if (gbl_sigint_flag) { - raise(SIGINT); - } else { - fputc('\n', out); - } - return; + fputc('\n', out); } + return; } fflush(stdin); norawmode();