From 1f02c35acb0c3b3f7534fb55384cf7f708b5b92d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 20 Oct 2014 22:47:16 -0400 Subject: in fact, only line feed/reverse line feed should cause scrolling aside from displaying text, of course --- src/screen.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/screen.c') diff --git a/src/screen.c b/src/screen.c index 52bb37f..acf6f61 100644 --- a/src/screen.c +++ b/src/screen.c @@ -173,7 +173,7 @@ void vt100_screen_show_string_ascii(VT100Screen *vt, char *buf, size_t len) if (col >= vt->grid->max.col) { vt100_screen_row_at(vt, vt->grid->cur.row)->wrapped = 1; - vt100_screen_move_to(vt, vt->grid->cur.row + 1, 0); + vt100_screen_move_to(vt, vt->grid->cur.row + 1, 0, 1); col = 0; } cell = vt100_screen_cell_at(vt, vt->grid->cur.row, col++); @@ -183,7 +183,7 @@ void vt100_screen_show_string_ascii(VT100Screen *vt, char *buf, size_t len) cell->attrs = vt->attrs; cell->is_wide = 0; } - vt100_screen_move_to(vt, vt->grid->cur.row, col); + vt100_screen_move_to(vt, vt->grid->cur.row, col, 0); } void vt100_screen_show_string_utf8(VT100Screen *vt, char *buf, size_t len) @@ -250,7 +250,7 @@ void vt100_screen_show_string_utf8(VT100Screen *vt, char *buf, size_t len) else { if (col + (is_wide ? 2 : 1) > vt->grid->max.col) { vt100_screen_row_at(vt, vt->grid->cur.row)->wrapped = 1; - vt100_screen_move_to(vt, vt->grid->cur.row + 1, 0); + vt100_screen_move_to(vt, vt->grid->cur.row + 1, 0, 1); col = 0; } cell = vt100_screen_cell_at(vt, vt->grid->cur.row, col); @@ -268,19 +268,23 @@ void vt100_screen_show_string_utf8(VT100Screen *vt, char *buf, size_t len) break; } } - vt100_screen_move_to(vt, vt->grid->cur.row, col); + vt100_screen_move_to(vt, vt->grid->cur.row, col, 0); } -void vt100_screen_move_to(VT100Screen *vt, int row, int col) +void vt100_screen_move_to(VT100Screen *vt, int row, int col, int scroll) { int top = vt->grid->scroll_top, bottom = vt->grid->scroll_bottom; if (row > bottom) { - vt100_screen_scroll_down(vt, row - bottom); + if (scroll) { + vt100_screen_scroll_down(vt, row - bottom); + } row = bottom; } else if (row < top) { - vt100_screen_scroll_up(vt, top - row); + if (scroll) { + vt100_screen_scroll_up(vt, top - row); + } row = top; } @@ -528,7 +532,7 @@ void vt100_screen_set_scroll_region( ? vt->grid->max.row - 1 : bottom; - vt100_screen_move_to(vt, vt->grid->scroll_top, 0); + vt100_screen_move_to(vt, vt->grid->scroll_top, 0, 0); } void vt100_screen_reset_text_attributes(VT100Screen *vt) -- cgit v1.2.3-54-g00ecf