aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-02-08 16:09:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-02-15 15:56:30 +0000
commitaca9af020241a4b7e4c172a009bf8d4fcfc4e16b (patch)
tree69fa26d8f3c6f57cd4f5ab47c2d75998a6879b70 /vt.c
parentconfig: map Control+wheel to font increase/decrease (diff)
vt: VS16 - variation selector 16 (emoji representation) should only affect emojis
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/vt.c b/vt.c
index 7529f302..4d2bf487 100644
--- a/vt.c
+++ b/vt.c
@@ -850,8 +850,14 @@ action_utf8_print(struct terminal *term, char32_t wc)
break;
case GRAPHEME_WIDTH_DOUBLE:
- if (unlikely(wc == 0xfe0f))
- width = 2;
+ if (unlikely(wc == 0xfe0f && new_cc->count == 2)) {
+ /* Only emojis should be affected by VS16 */
+ const utf8proc_property_t *props =
+ utf8proc_get_property(new_cc->chars[0]);
+
+ if (props->boundclass == UTF8PROC_BOUNDCLASS_EXTENDED_PICTOGRAPHIC)
+ width = 2;
+ }
new_cc->width = min(grapheme_width + width, 2);
break;