mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-11 08:21:01 -04:00
csi: implement cursor horizontal absolute
This commit is contained in:
parent
637820bef5
commit
da0a65d499
1 changed files with 13 additions and 0 deletions
13
csi.c
13
csi.c
|
|
@ -295,6 +295,19 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'G': {
|
||||||
|
/* Cursor horizontal absolute */
|
||||||
|
int col = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||||
|
if (col == 0)
|
||||||
|
col = 1;
|
||||||
|
|
||||||
|
if (col > term->grid.cols)
|
||||||
|
col = term->grid.cols;
|
||||||
|
|
||||||
|
grid_cursor_to(&term->grid, term->grid.cursor.row, col);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'H': {
|
case 'H': {
|
||||||
/* Move cursor */
|
/* Move cursor */
|
||||||
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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue