diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-06-02 18:12:01 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-06-02 18:12:01 +0000 |
| commit | 2f7e5aed40d963fc065f50d1601f7204db93fb32 (patch) | |
| tree | a5c02d4cccb081ecce2e1e6ae36e02552fa436d5 /grid.c | |
| parent | Merge branch 'url-mode-off-by-one' (diff) | |
| parent | grid: don’t cut multi-column chars in half when resizing the alt screen (diff) | |
Merge branch 'dont-split-multi-column-chars-when-resizing-alt-screen'
Diffstat (limited to 'grid.c')
| -rw-r--r-- | grid.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -194,11 +194,15 @@ grid_resize_without_reflow( new_row->dirty = old_row->dirty; new_row->linebreak = false; - /* Clear "new" columns */ if (new_cols > old_cols) { + /* Clear "new" columns */ memset(&new_row->cells[old_cols], 0, sizeof(struct cell) * (new_cols - old_cols)); new_row->dirty = true; + } else if (old_cols > new_cols) { + /* Make sure we don't cut a multi-column character in two */ + for (int i = new_cols; i > 0 && old_row->cells[i].wc > CELL_SPACER; i--) + new_row->cells[i - 1].wc = 0; } /* Map sixels on current "old" row to current "new row" */ |
