From 0325743daff41b74466fb198eee5774d0c2ac004 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Mon, 22 Jul 2019 15:34:03 +0100 Subject: allow [ENTER] in box, arrow, erase, and visual mode --- gramscii.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gramscii.c') diff --git a/gramscii.c b/gramscii.c index 0ca2291..5e5a9b1 100644 --- a/gramscii.c +++ b/gramscii.c @@ -485,7 +485,7 @@ void get_box(){ redraw(); step = 1; draw_box(x,y,NOFIX); - while((c=getchar())!=EOF && c != 27 && c!= 'b'){ + while((c=getchar())!=EOF && c != 27 && c!= 'b' && c != '\n'){ if (change_style(c)) goto update_box; if (!move_around(c)) @@ -498,7 +498,7 @@ update_box: status_bar(); show_cursor(); } - if (c == 'b'){ + if (c == 'b' || c == '\n'){ draw_box(orig_x, orig_y, FIX); modified = 1; } @@ -563,7 +563,7 @@ void get_arrow(){ redraw(); step = 1; draw_arrow(x,y, arrow, 0, NOFIX); - while((c=getchar())!=EOF && c != 27 && c!= 'a'){ + while((c=getchar())!=EOF && c != 27 && c!= 'a' && c != '\n'){ if (change_style(c)) goto update_arrow; if (!move_around(c)) @@ -583,7 +583,7 @@ update_arrow: status_bar(); show_cursor(); } - if (c == 'a'){ + if (c == 'a' || c == '\n'){ draw_arrow(orig_x, orig_y, arrow, arrow_len, FIX); modified = 1; } @@ -616,7 +616,7 @@ void delete(){ int orig_x = x, orig_y = y; status_bar(); show_cursor(); - while((c=getchar())!=EOF && c!=27 && c!= 'x'){ + while((c=getchar())!=EOF && c!=27 && c!= 'x' && c != '\n'){ if (!move_around(c)) continue; check_bound(); do_delete(orig_x, orig_y); @@ -710,7 +710,7 @@ void visual_box(){ step = 1; set_video(VIDEO_REV); draw_box(x,y,NOFIX); - while((c=getchar())!=EOF && c != 27 && c!= 'v'){ + while((c=getchar())!=EOF && c != 27 && c!= 'v' && c != '\n'){ if (!move_around(c)) switch(c){ case 'f':/* fill */ f = get_key("fill char: "); /** FALLTHROUGH **/ -- cgit v1.2.3