From a48488a1329a84b5e4dd3853246e1b14b2144980 Mon Sep 17 00:00:00 2001 From: dzaima Date: Thu, 20 Oct 2022 16:36:33 +0300 Subject: [PATCH] enable bracketed paste, add sanity check in syntax highlighter --- src/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index ef330544..8ed090c3 100644 --- a/src/main.c +++ b/src/main.c @@ -121,6 +121,7 @@ static NOINLINE void repl_init() { else if (chr_in(c0, chrs_m1)) SET1(6); else if (chr_in(c0, chrs_dmd)) SET1(8); else if (chr_in(c0, chrs_m2)) SET1(7); else if (chr_in(c0, chrs_blk)) SET1(10); else SET1(0); + if (i<=i0) break; // in case the above code fails to progress forward, at least don't get in an infinite loop } end: dec(charObj); @@ -441,8 +442,8 @@ void cbqn_runLine0(char* ln, i64 read) { HArr* expla = toHArr(expl); usz ia=PIA(expla); for(usz i=0; ia[i]); - putchar('\n'); + printRaw(expla->a[i]); + putchar('\n'); } dec(expl); return; @@ -675,6 +676,7 @@ int main(int argc, char* argv[]) { replxx_set_highlighter_callback(replxx, highlighter_replxx, NULL); replxx_set_hint_callback(replxx, hint_replxx, NULL); replxx_set_completion_callback(replxx, complete_replxx, NULL); + replxx_enable_bracketed_paste(replxx); while(true) { const char* ln = replxx_input(replxx, " ");