diff options
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 20 |
1 files changed, 12 insertions, 8 deletions
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) |