diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b36e86b..466947cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,8 +79,11 @@ * Regression: assertion in `url-mode.c` when activating a second URL via `show-urls-persistent` ([#2000][2000]). * Build failure (`srgb.h` not found) when doing a parallel build. +* Regression: reflowing (changing the window size) removing empty + lines ([#2011][2011]). [2000]: https://codeberg.org/dnkl/foot/issues/2000 +[2011]: https://codeberg.org/dnkl/foot/issues/2011 ### Security diff --git a/grid.c b/grid.c index cb6e1a91..df7ef61c 100644 --- a/grid.c +++ b/grid.c @@ -985,14 +985,12 @@ grid_resize_and_reflow( underline_range = underline_range_terminator = NULL; if (unlikely(col_count > 0 && coalesced_linebreaks > 0)) { - for (size_t apa = 0; apa < coalesced_linebreaks; apa++) { + for (size_t line_no = 0; line_no < coalesced_linebreaks; line_no++) { /* Erase the remaining cells */ memset(&new_row->cells[new_col_idx], 0, (new_cols - new_col_idx) * sizeof(new_row->cells[0])); new_row->linebreak = true; - - if (r + 1 < old_rows) - line_wrap(); + line_wrap(); } coalesced_linebreaks = 0;