vt: cache grapheme cluster width in composed struct

* Use regular wcswidth() to calculate the width
* Explicitly set to ‘2’ if we see a emoji variant selector
* Cache the result in the composed struct
This commit is contained in:
Daniel Eklöf 2021-05-27 20:07:28 +02:00
parent b9ef703eb1
commit 0a9531ac6c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 11 additions and 12 deletions

View file

@ -87,6 +87,7 @@ struct damage {
struct composed {
wchar_t chars[20];
uint8_t count;
int width;
};
struct row_uri_range {