mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-25 09:05:47 -04: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 */
|
/* From cursor to end of line */
|
||||||
start = term->grid.linear_cursor;
|
start = term->grid.linear_cursor;
|
||||||
end = grid_cursor_linear(
|
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;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
|
|
@ -202,7 +204,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
start = grid_cursor_linear(
|
start = grid_cursor_linear(
|
||||||
&term->grid, term->grid.cursor.row, 0);
|
&term->grid, term->grid.cursor.row, 0);
|
||||||
end = grid_cursor_linear(
|
end = grid_cursor_linear(
|
||||||
&term->grid, term->grid.cursor.row, term->grid.cols - 1);
|
&term->grid, term->grid.cursor.row, term->grid.cols);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
@ -217,6 +219,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
case 'A': {
|
case 'A': {
|
||||||
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||||
grid_cursor_up(&term->grid, count);
|
grid_cursor_up(&term->grid, count);
|
||||||
|
//LOG_DBG("CSI: A: row = %d, col = %d", term->grid.cursor.row, term->grid.cursor.col);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,12 +232,14 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
case 'C': {
|
case 'C': {
|
||||||
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||||
grid_cursor_right(&term->grid, count);
|
grid_cursor_right(&term->grid, count);
|
||||||
|
//LOG_DBG("CSI: C: row = %d, col = %d", term->grid.cursor.row, term->grid.cursor.col);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 'D': {
|
case 'D': {
|
||||||
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
int count = term->vt.params.idx > 0 ? term->vt.params.v[0].value : 1;
|
||||||
grid_cursor_left(&term->grid, count);
|
grid_cursor_left(&term->grid, count);
|
||||||
|
//LOG_DBG("CSI: D: row = %d, col = %d", term->grid.cursor.row, term->grid.cursor.col);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue