From f87adba350d2be28721bfec8d1bf8d7312302e08 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Sun, 10 Sep 2017 20:16:25 +1000 Subject: [PATCH] Another try at backspace stuff --- utils/magiedit/main.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/utils/magiedit/main.c b/utils/magiedit/main.c index 8f23198..424308f 100644 --- a/utils/magiedit/main.c +++ b/utils/magiedit/main.c @@ -405,10 +405,22 @@ char *message_editor() { position_x = strlen(line); } } - redraw = 1; + if (position_y < top_of_screen) { top_of_screen--; } + + if (position_y <= body_line_count) { + for (i=position_y; i< body_line_count && i < top_of_screen + 17;i++) { + od_set_cursor(i - top_of_screen + 5, 1); + od_printf("%s", body_lines[i]); + od_clr_line(); + } + } + for (;i< top_of_screen + 17;i++) { + od_set_cursor(i - top_of_screen + 5, 1); + od_clr_line(); + } } else { if (position_x >= strlen(line)) { strncpy(line_cpy, line, strlen(line) - 1);