aboutsummaryrefslogtreecommitdiff
path: root/vt.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-11-22 22:02:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-11-23 18:50:05 +0000
commitc1c0f11821e36e96add5060916d83533308b4126 (patch)
tree4dce038269cbd99306f5c05e009e318660f78d24 /vt.c
parentchangelog: add new ‘unreleased’ section (diff)
config: add tweak.grapheme-width-method=max
‘max’ is a new value for ‘tweak.grapheme-width-method’. When enabled, the width of a grapheme cluster is that of the cluster’s widest codepoint.
Diffstat (limited to 'vt.c')
-rw-r--r--vt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/vt.c b/vt.c
index 687be912..736a2cfd 100644
--- a/vt.c
+++ b/vt.c
@@ -792,6 +792,10 @@ action_utf8_print(struct terminal *term, wchar_t wc)
composed != NULL ? composed->width : base_width;
switch (term->conf->tweak.grapheme_width_method) {
+ case GRAPHEME_WIDTH_MAX:
+ new_cc->width = max(grapheme_width, width);
+ break;
+
case GRAPHEME_WIDTH_DOUBLE:
if (unlikely(wc == 0xfe0f))
width = 2;