mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
grid: reflow: don’t trim trailing empty cells from logical lines
When a line in the old grid (the one being reflowed) doesn’t have a hard linebreak, don’t trim trailing empty cells. Doing so means we’ll “compress” (remove) empty cells between text if/when we revert to a larger window size. The output from neofetch suffers from this; it prints a logo to the left, and system information to the right. The logo and the system info column is separated by empty cells (i.e. *not* spaces). If the window is reduced in size such that the system info is pushed to a new line, each logo line ends with a number of empty cells. The next time the window is resized, these empty cells were ignored (i.e. removed). That meant that once the window was enlarged again, the system info column was a) no longer aligned, and b) had been pulled closer to the logo. This patch doesn’t special case trailing empty cells when the line being reflowed doesn’t have a hard linebreak. This means e.g. ‘ls’ output is unaffected. Closes #1055
This commit is contained in:
parent
cdd46cdf85
commit
9567694bab
2 changed files with 8 additions and 0 deletions
|
|
@ -61,6 +61,9 @@
|
||||||
|
|
||||||
* Graphical corruption when viewport is at the top of the scrollback,
|
* Graphical corruption when viewport is at the top of the scrollback,
|
||||||
and the output is scrolling.
|
and the output is scrolling.
|
||||||
|
* Improved text reflow of logical lines with trailing empty cells ([#1055][1055])
|
||||||
|
|
||||||
|
[1055]: https://codeberg.org/dnkl/foot/issues/1055
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
5
grid.c
5
grid.c
|
|
@ -703,6 +703,11 @@ grid_resize_and_reflow(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!old_row->linebreak /*&& col_count > 0*/) {
|
||||||
|
/* Don’t truncate logical lines */
|
||||||
|
col_count = old_cols;
|
||||||
|
}
|
||||||
|
|
||||||
xassert(col_count >= 0 && col_count <= old_cols);
|
xassert(col_count >= 0 && col_count <= old_cols);
|
||||||
|
|
||||||
/* Do we have a (at least one) tracking point on this row */
|
/* Do we have a (at least one) tracking point on this row */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue