diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-07-03 20:21:44 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-07-03 20:21:44 +0000 |
| commit | 35d5035f614493196e3b93e2b60d6f88df75e067 (patch) | |
| tree | f597eff1e1f15317ab156a34fc897f7dd6d303c8 | |
| parent | csi: cleanup (diff) | |
csi: fix bug: cursor horizontal absolute (<ESC> Pn G) was off-by-one
| -rw-r--r-- | csi.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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; } |
