mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
vt: execute: \t: use tab stops from tab stop list
Instead of assuming hardcoded 8-width tab stops, use the tab stops from the tab stop list.
This commit is contained in:
parent
9ff48c2015
commit
65ff3656f7
1 changed files with 8 additions and 3 deletions
11
vt.c
11
vt.c
|
|
@ -866,9 +866,14 @@ action(struct terminal *term, enum action _action, uint8_t c)
|
|||
|
||||
case '\x09': {
|
||||
/* HT - horizontal tab */
|
||||
int col = term->cursor.col;
|
||||
col = (col + 8) / 8 * 8;
|
||||
term_cursor_right(term, col - term->cursor.col);
|
||||
int new_col = term->cursor.col;
|
||||
tll_foreach(term->tab_stops, it) {
|
||||
if (it->item >= term->cursor.col) {
|
||||
new_col = it->item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
term_cursor_right(term, new_col - term->cursor.col);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue