From 6183f7f64a10465b429f70c713102ced2e0517bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 16 Jul 2020 07:41:51 +0200 Subject: [PATCH] vt: utf8: handle multi-column spacer values correctly when combining --- vt.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/vt.c b/vt.c index 618611c6..feac9040 100644 --- a/vt.c +++ b/vt.c @@ -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))