aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-05-30 17:36:59 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-24 15:30:45 +0000
commit6c70cd9366db76f10d822252151a782f638d1f45 (patch)
tree65a07e598034bc107a918ca993ba94871eaa729b /vt.c
parentvt: cache grapheme cluster width in composed struct (diff)
vt: don’t force cols=2 when we see an emoji variant selector
Fish appears to be the only shell expecting this. The rest probably just does wcswidth(), like usual.
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/vt.c b/vt.c
index 6ad539d7..aff3131b 100644
--- a/vt.c
+++ b/vt.c
@@ -733,10 +733,12 @@ action_utf8_print(struct terminal *term, wchar_t wc)
if (term->composed_count < CELL_COMB_CHARS_HI) {
/* TODO: grapheme cluster width */
int grapheme_width = wcswidth(new_cc.chars, new_cc.count);
+#if 0 /* Fish expects this, but nothing else */
if (new_cc.chars[new_cc.count - 1] == 0xfe0f) {
/* Emoji selector */
- grapheme_width = 2;
+ grapheme_width = max(2, grapheme_width);
}
+#endif
new_cc.width = grapheme_width;
term->composed_count++;