aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2026-09-18 08:46:33 +0000
committerDaniel Eklöf <daniel@ekloef.se>2026-09-18 11:32:53 +0000
commitcb2771788998f6a6288e2de8273c55a8214551e0 (patch)
tree4aa78972c5df60f497b7504105d8aa59f5c1780d /scripts
parentshm: clang 23 complains max_pool_size is unused on x86 (which it is) (diff)
grid: reflow: fix two issues when truncating wide characters
When resizing to a very small grid, it may be impossible to fit a wide character (for example, a 6-cell character won't ever fit in a 5-cell grid). What we do is replace with wide character with a space. There were however two issues: 1. We never set the attributes of the space cell, only the wc member 2. We breaked out of the loop, causing any tracking points associated with any of the SPACER cells to never be matched. The last point is very real, since e.g. OSC-8 links cover the spacer cells. The first point is easy to fix; we first copy the entire cell from the old grid, then replace wc with 0. The second point is somewhat more complex. We remove the break, to ensure we run all the tracking point logic. Then, we only write the empty cell in the first iteration. Subsequent iterations do nothing (to the new grid). Then, to ensure tracking points associated with the spacer cells point to a valid cell, we keep the new_col_idx value at the first (now empty) cell. Only when we've processed the last SPACER cell do we increment new_col_idx once. This ensures consistency (the wide character was replaced with a single-cell character, thus new_col_idx should only be incremented by one).
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions