summaryrefslogtreecommitdiff
path: root/gramscii.c
diff options
context:
space:
mode:
authorKatolaZ <katolaz@freaknet.org>2019-07-22 15:34:03 +0100
committerKatolaZ <katolaz@freaknet.org>2019-07-22 15:34:03 +0100
commit0325743daff41b74466fb198eee5774d0c2ac004 (patch)
tree0cf6f3da248f2f13af8e02d7cc5e75471b3713ea /gramscii.c
parent0c2294582b16427c87114418b9f154588dc641e0 (diff)
allow [ENTER] in box, arrow, erase, and visual mode
Diffstat (limited to 'gramscii.c')
-rw-r--r--gramscii.c12
1 files changed, 6 insertions, 6 deletions
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 **/