mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-21 05:33:45 -04:00
grid: reflow: don't insert <width> spacer cells for *every* empty cell
Only do it for the last, non-empty cell.
This commit is contained in:
parent
32a155fbf4
commit
c07d14e1c0
2 changed files with 10 additions and 7 deletions
|
|
@ -51,6 +51,8 @@
|
||||||
* Command lines for **pipe-visible** and **pipe-scrollback** are now
|
* Command lines for **pipe-visible** and **pipe-scrollback** are now
|
||||||
tokenized (i.e. syntax checked) when the configuration is loaded,
|
tokenized (i.e. syntax checked) when the configuration is loaded,
|
||||||
instead of every time the key binding is executed.
|
instead of every time the key binding is executed.
|
||||||
|
* Incorrect multi-column character spacer insertion when reflowing
|
||||||
|
text.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
15
grid.c
15
grid.c
|
|
@ -261,14 +261,15 @@ grid_reflow(struct grid *grid, int new_rows, int new_cols,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new_col_idx++;
|
new_col_idx++;
|
||||||
|
}
|
||||||
|
|
||||||
/* For multi-column characters, insert spacers in the
|
/* For multi-column characters, insert spacers in the
|
||||||
* subsequent cells */
|
* subsequent cells */
|
||||||
for (size_t i = 0; i < width - 1; i++) {
|
const struct cell *old_cell = &old_row->cells[c];
|
||||||
assert(new_col_idx < new_cols);
|
for (size_t i = 0; i < width - 1; i++) {
|
||||||
print_spacer();
|
assert(new_col_idx < new_cols);
|
||||||
new_col_idx++;
|
print_spacer();
|
||||||
}
|
new_col_idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
c += width - 1;
|
c += width - 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue