mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
csi: saturate row/col when setting cursor position
This commit is contained in:
parent
2b3f3711fc
commit
44206b49d4
1 changed files with 5 additions and 1 deletions
6
csi.c
6
csi.c
|
|
@ -291,6 +291,11 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
if (col == 0)
|
||||
col = 1;
|
||||
|
||||
if (row > term->grid.rows)
|
||||
row = term->grid.rows;
|
||||
if (col > term->grid.cols)
|
||||
col = term->grid.cols;
|
||||
|
||||
grid_cursor_to(&term->grid, row - 1, col - 1);
|
||||
break;
|
||||
}
|
||||
|
|
@ -384,7 +389,6 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
&term->grid,
|
||||
term->grid.cursor.row - term->grid.scrolling_region.start,
|
||||
count);
|
||||
grid_cursor_to(&term->grid, term->grid.cursor.row, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue