mirror of
https://github.com/janet-lang/janet
synced 2025-01-26 07:06:51 +00:00
Make style consistent.
This commit is contained in:
parent
e9fdbe0c89
commit
c19bbfce78
@ -25,7 +25,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <janet.h>
|
#include <janet.h>
|
||||||
#include <stdbool.h>
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -41,7 +40,7 @@ void janet_line_deinit();
|
|||||||
void janet_line_get(const char *p, JanetBuffer *buffer);
|
void janet_line_get(const char *p, JanetBuffer *buffer);
|
||||||
Janet janet_line_getter(int32_t argc, Janet *argv);
|
Janet janet_line_getter(int32_t argc, Janet *argv);
|
||||||
|
|
||||||
static JANET_THREAD_LOCAL bool gbl_cancel_current_repl_form = false;
|
static JANET_THREAD_LOCAL int gbl_cancel_current_repl_form = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Line Editing
|
* Line Editing
|
||||||
@ -60,9 +59,9 @@ Janet janet_line_getter(int32_t argc, Janet *argv) {
|
|||||||
|
|
||||||
Janet result;
|
Janet result;
|
||||||
if (gbl_cancel_current_repl_form) {
|
if (gbl_cancel_current_repl_form) {
|
||||||
gbl_cancel_current_repl_form = false;
|
gbl_cancel_current_repl_form = 0;
|
||||||
|
|
||||||
// Signal that the user bailed out of the current form
|
/* Signal that the user bailed out of the current form */
|
||||||
result = janet_ckeywordv("cancel");
|
result = janet_ckeywordv("cancel");
|
||||||
} else {
|
} else {
|
||||||
result = janet_wrap_buffer(buf);
|
result = janet_wrap_buffer(buf);
|
||||||
@ -759,7 +758,7 @@ static int line() {
|
|||||||
kleft();
|
kleft();
|
||||||
break;
|
break;
|
||||||
case 3: /* ctrl-c */
|
case 3: /* ctrl-c */
|
||||||
gbl_cancel_current_repl_form = true;
|
gbl_cancel_current_repl_form = 1;
|
||||||
clearlines();
|
clearlines();
|
||||||
return -1;
|
return -1;
|
||||||
case 4: /* ctrl-d, eof */
|
case 4: /* ctrl-d, eof */
|
||||||
|
Loading…
Reference in New Issue
Block a user