mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
csi: implement 'CHT' - Cursor Horizontal Tab
This commit is contained in:
parent
fd8a399274
commit
7f4b2c5755
1 changed files with 16 additions and 0 deletions
16
csi.c
16
csi.c
|
|
@ -624,6 +624,22 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'I': {
|
||||||
|
/* CHT - Tab Forward (param is number of tab stops to move through) */
|
||||||
|
for (int i = 0; i < vt_param_get(term, 0, 1); i++) {
|
||||||
|
int new_col = term->cols - 1;
|
||||||
|
tll_foreach(term->tab_stops, it) {
|
||||||
|
if (it->item > term->cursor.point.col) {
|
||||||
|
new_col = it->item;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert(new_col >= term->cursor.point.col);
|
||||||
|
term_cursor_right(term, new_col - term->cursor.point.col);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case 'Z':
|
case 'Z':
|
||||||
/* CBT - Back tab (param is number of tab stops to move back through) */
|
/* CBT - Back tab (param is number of tab stops to move back through) */
|
||||||
for (int i = 0; i < vt_param_get(term, 0, 1); i++) {
|
for (int i = 0; i < vt_param_get(term, 0, 1); i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue