diff --git a/CHANGELOG.md b/CHANGELOG.md index ead014cf..ae8e0b19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -109,6 +109,10 @@ config values (e.g. letter offsets, line height etc). * Selection being stuck visually when `IL` and `DL`.` * URL underlines sometimes still being visible after exiting URL mode. +* Handling of Unicode Variation Selector-16 when + `grapheme-width-method` is set to either `max` or `wcswidth` (the + default). Before this, it was only handled correctly when + `grapheme-width-method=double-width`. [1173]: https://codeberg.org/dnkl/foot/issues/1173 [1190]: https://codeberg.org/dnkl/foot/issues/1190 diff --git a/vt.c b/vt.c index 91f00e6f..d5167622 100644 --- a/vt.c +++ b/vt.c @@ -832,6 +832,8 @@ action_utf8_print(struct terminal *term, char32_t wc) switch (term->conf->tweak.grapheme_width_method) { case GRAPHEME_WIDTH_MAX: + if (unlikely(wc == 0xfe0f)) + width = 2; new_cc->width = max(grapheme_width, width); break; @@ -842,7 +844,10 @@ action_utf8_print(struct terminal *term, char32_t wc) break; case GRAPHEME_WIDTH_WCSWIDTH: - new_cc->width = grapheme_width + width; + if (unlikely(wc == 0xfe0f)) + new_cc->width = 2; + else + new_cc->width = grapheme_width + width; break; }