aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c
index 0c8ced5..94e70f9 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -121,6 +121,14 @@ void runes_screen_move_to(RunesTerm *t, int row, int col)
row++;
}
+ if (col < 0) {
+ col = 0;
+ }
+
+ if (col > t->scr.max.col) {
+ col = t->scr.max.col;
+ }
+
scr->cur.row = row;
scr->cur.col = col;
}