mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
csi: VPA: saturate row
This commit is contained in:
parent
86519f93ba
commit
d4b6bc77d5
1 changed files with 4 additions and 0 deletions
4
csi.c
4
csi.c
|
|
@ -247,10 +247,14 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
return write(term->ptmx, "\033[?6c", 5) == 5;
|
return write(term->ptmx, "\033[?6c", 5) == 5;
|
||||||
|
|
||||||
case 'd': {
|
case 'd': {
|
||||||
|
/* VPA - vertical line position absolute */
|
||||||
int row = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
int row = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||||
if (row == 0)
|
if (row == 0)
|
||||||
row = 1;
|
row = 1;
|
||||||
|
|
||||||
|
if (row > term->grid.rows)
|
||||||
|
row = term->grid.rows;
|
||||||
|
|
||||||
grid_cursor_to(&term->grid, row - 1, term->grid.cursor.col);
|
grid_cursor_to(&term->grid, row - 1, term->grid.cursor.col);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue