mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
csi: implement CSI 0g and CSI 3g
* 0g - clear tab stop at current column * 3g - clear all tab stops
This commit is contained in:
parent
69e0e454fa
commit
9840291100
1 changed files with 26 additions and 0 deletions
26
csi.c
26
csi.c
|
|
@ -357,6 +357,32 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
term_cursor_left(term, vt_param_get(term, 0, 1));
|
term_cursor_left(term, vt_param_get(term, 0, 1));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'g': {
|
||||||
|
int param = vt_param_get(term, 0, 0);
|
||||||
|
switch (param) {
|
||||||
|
case 0:
|
||||||
|
/* Clear tab stop at *current* column */
|
||||||
|
tll_foreach(term->tab_stops, it) {
|
||||||
|
if (it->item == term->cursor.col)
|
||||||
|
tll_remove(term->tab_stops, it);
|
||||||
|
else if (it->item > term->cursor.col)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
/* Clear *all* tabs */
|
||||||
|
tll_free(term->tab_stops);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
UNHANDLED();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'G': {
|
case 'G': {
|
||||||
/* Cursor horizontal absolute */
|
/* Cursor horizontal absolute */
|
||||||
struct coord new_cursor = term_cursor_rel_to_abs(
|
struct coord new_cursor = term_cursor_rel_to_abs(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue