summaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-10-20 22:47:16 -0400
committerJesse Luehrs <doy@tozt.net>2014-10-20 22:47:16 -0400
commit1f02c35acb0c3b3f7534fb55384cf7f708b5b92d (patch)
treef89d2a535c0de3a111e10233a1b3baaf2531ff72 /src/screen.c
parent71ddc90f1a0f62a22edf63334321d66e7f0467ad (diff)
downloadlibvt100-1f02c35acb0c3b3f7534fb55384cf7f708b5b92d.tar.gz
libvt100-1f02c35acb0c3b3f7534fb55384cf7f708b5b92d.zip
in fact, only line feed/reverse line feed should cause scrolling
aside from displaying text, of course
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c20
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)