mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
vt: limit grapheme width to 2 cells
All emoji graphemes are double-width. Foot doesn’t support non-latin scripts. Ergo, this should result in the Right Thing, even though we’re not doing it the Right Way. Note that we’re now breaking cursor synchronization with nearly all applications. But the way I see it, the applications need to be updated.
This commit is contained in:
parent
55bd3cfd62
commit
031e8f5987
1 changed files with 3 additions and 5 deletions
8
vt.c
8
vt.c
|
|
@ -766,11 +766,9 @@ action_utf8_print(struct terminal *term, wchar_t wc)
|
|||
|
||||
int grapheme_width = composed != NULL ? composed->width : base_width;
|
||||
|
||||
if (wc == 0xfe0f && grapheme_width < 2)
|
||||
grapheme_width = 2;
|
||||
else
|
||||
grapheme_width += width;
|
||||
new_cc->width = grapheme_width;
|
||||
if (wc == 0xfe0f)
|
||||
width = 2;
|
||||
new_cc->width = min(max(grapheme_width, width), 2);
|
||||
|
||||
term->composed_count++;
|
||||
composed_insert(&term->composed, new_cc);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue