mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
csi: fix line clearing; the erase range 'end' is exclusive
This commit is contained in:
parent
3338b816a3
commit
a537934e4b
1 changed files with 7 additions and 2 deletions
9
csi.c
9
csi.c
|
|
@ -187,7 +187,9 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
/* From cursor to end of line */
|
||||
start = term->grid.linear_cursor;
|
||||
end = grid_cursor_linear(
|
||||
&term->grid, term->grid.cursor.row, term->grid.cols - 1);
|
||||
&term->grid, term->grid.cursor.row, term->grid.cols);
|
||||
//LOG_WARN("CSI: K: linear = %d, row = %d, col = %d, end = %d",
|
||||
// start, term->grid.cursor.row, term->grid.cursor.col, end);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
|
@ -202,7 +204,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
start = grid_cursor_linear(
|
||||
&term->grid, term->grid.cursor.row, 0);
|
||||
end = grid_cursor_linear(
|
||||
&term->grid, term->grid.cursor.row, term->grid.cols - 1);
|
||||
&term->grid, term->grid.cursor.row, term->grid.cols);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
@ -217,6 +219,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
case 'A': {
|
||||
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||
grid_cursor_up(&term->grid, count);
|
||||
//LOG_DBG("CSI: A: row = %d, col = %d", term->grid.cursor.row, term->grid.cursor.col);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -229,12 +232,14 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
case 'C': {
|
||||
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||
grid_cursor_right(&term->grid, count);
|
||||
//LOG_DBG("CSI: C: row = %d, col = %d", term->grid.cursor.row, term->grid.cursor.col);
|
||||
break;
|
||||
}
|
||||
|
||||
case 'D': {
|
||||
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||
grid_cursor_left(&term->grid, count);
|
||||
//LOG_DBG("CSI: D: row = %d, col = %d", term->grid.cursor.row, term->grid.cursor.col);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue