csi: fix bug: cursor horizontal absolute (<ESC> Pn G) was off-by-one

This commit is contained in:
Daniel Eklöf 2019-07-03 22:21:44 +02:00
parent 2f3f4ac56f
commit 35d5035f61
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

8
csi.c
View file

@ -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;
}