mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-15 05:33:58 -04:00
vt: TAB: don’t print a ‘\t’ to the grid if the *current* cell isn’t empty
If the cursor is already at the right edge, our logic that checked for non-empty cells failed; it didn’t check the current cell. Fix by initializing ‘emit_tab_char’ to true/false, depending on the contents of the current cell.
This commit is contained in:
parent
4d56dd430b
commit
9d3351472d
1 changed files with 4 additions and 3 deletions
7
vt.c
7
vt.c
|
|
@ -174,12 +174,13 @@ action_execute(struct terminal *term, uint8_t c)
|
||||||
xassert(new_col >= start_col);
|
xassert(new_col >= start_col);
|
||||||
xassert(new_col < term->cols);
|
xassert(new_col < term->cols);
|
||||||
|
|
||||||
|
|
||||||
bool emit_tab_char = true;
|
|
||||||
struct row *row = term->grid->cur_row;
|
struct row *row = term->grid->cur_row;
|
||||||
|
|
||||||
|
bool emit_tab_char = (row->cells[start_col].wc == 0 ||
|
||||||
|
row->cells[start_col].wc == L' ');
|
||||||
|
|
||||||
/* Check if all cells from here until the next tab stop are empty */
|
/* Check if all cells from here until the next tab stop are empty */
|
||||||
for (const struct cell *cell = &row->cells[start_col];
|
for (const struct cell *cell = &row->cells[start_col + 1];
|
||||||
cell < &row->cells[new_col];
|
cell < &row->cells[new_col];
|
||||||
cell++)
|
cell++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue