mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05: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
|
||||
tokenized (i.e. syntax checked) when the configuration is loaded,
|
||||
instead of every time the key binding is executed.
|
||||
* Incorrect multi-column character spacer insertion when reflowing
|
||||
text.
|
||||
|
||||
|
||||
### 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++;
|
||||
}
|
||||
|
||||
/* For multi-column characters, insert spacers in the
|
||||
* subsequent cells */
|
||||
for (size_t i = 0; i < width - 1; i++) {
|
||||
assert(new_col_idx < new_cols);
|
||||
print_spacer();
|
||||
new_col_idx++;
|
||||
}
|
||||
/* For multi-column characters, insert spacers in the
|
||||
* subsequent cells */
|
||||
const struct cell *old_cell = &old_row->cells[c];
|
||||
for (size_t i = 0; i < width - 1; i++) {
|
||||
assert(new_col_idx < new_cols);
|
||||
print_spacer();
|
||||
new_col_idx++;
|
||||
}
|
||||
|
||||
c += width - 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue