summaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c
index b909cfb..e031e3e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -261,6 +261,13 @@ void vt100_screen_move_to(VT100Screen *vt, int row, int col)
: col >= vt->grid->max.col ? vt->grid->max.col - 1
: col;
+ if (vt->origin_mode) {
+ row += vt->grid->scroll_top;
+ if (row > vt->grid->scroll_bottom) {
+ row = vt->grid->scroll_bottom;
+ }
+ }
+
vt->grid->cur.row = row;
vt->grid->cur.col = col;
}
@@ -835,6 +842,16 @@ void vt100_screen_reset_bracketed_paste(VT100Screen *vt)
vt->bracketed_paste = 0;
}
+void vt100_screen_set_origin_mode(VT100Screen *vt)
+{
+ vt->origin_mode = 1;
+}
+
+void vt100_screen_reset_origin_mode(VT100Screen *vt)
+{
+ vt->origin_mode = 0;
+}
+
void vt100_screen_set_window_title(VT100Screen *vt, char *buf, size_t len)
{
free(vt->title);