vt: utf8: handle multi-column spacer values correctly when combining

This commit is contained in:
Daniel Eklöf 2020-07-16 07:41:51 +02:00
parent 9eb9a3d8a5
commit 6183f7f64a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

9
vt.c
View file

@ -540,15 +540,12 @@ action_utf8_print(struct terminal *term, wchar_t wc)
if (!term->grid->cursor.lcf)
base_col--;
while (row->cells[base_col].wc == CELL_MULT_COL_SPACER && base_col > 0)
base_col--;
assert(base_col >= 0 && base_col < term->cols);
wchar_t base = row->cells[base_col].wc;
/* Handle double-column glyphs */
if (base == 0 && base_col > 0) {
base_col--;
base = row->cells[base_col].wc;
}
const struct composed *composed =
(base >= CELL_COMB_CHARS_LO &&
base < (CELL_COMB_CHARS_LO + term->composed_count))