mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05: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': {
|
||||
/* Cursor horizontal absolute */
|
||||
int col = param_get(term, 0, 1);
|
||||
|
||||
if (col > term->cols)
|
||||
col = term->cols;
|
||||
|
||||
term_cursor_to(term, term->cursor.row, col);
|
||||
int col = min(param_get(term, 0, 1), term->cols);
|
||||
term_cursor_to(term, term->cursor.row, col - 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue