mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-24 09:05:48 -04:00
csi: fix bug: cursor horizontal absolute (<ESC> Pn G) was off-by-one
This commit is contained in:
parent
2f3f4ac56f
commit
35d5035f61
1 changed files with 2 additions and 6 deletions
8
csi.c
8
csi.c
|
|
@ -314,12 +314,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
|
|
||||||
case 'G': {
|
case 'G': {
|
||||||
/* Cursor horizontal absolute */
|
/* Cursor horizontal absolute */
|
||||||
int col = param_get(term, 0, 1);
|
int col = min(param_get(term, 0, 1), term->cols);
|
||||||
|
term_cursor_to(term, term->cursor.row, col - 1);
|
||||||
if (col > term->cols)
|
|
||||||
col = term->cols;
|
|
||||||
|
|
||||||
term_cursor_to(term, term->cursor.row, col);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue