mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-17 05:33:52 -04:00
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:
parent
b9ef703eb1
commit
0a9531ac6c
3 changed files with 11 additions and 12 deletions
8
util.h
8
util.h
|
|
@ -35,11 +35,3 @@ sdbm_hash(const char *s)
|
|||
|
||||
return hash;
|
||||
}
|
||||
|
||||
#include <wchar.h>
|
||||
static inline int
|
||||
my_wcswidth(const wchar_t *s, size_t n)
|
||||
{
|
||||
int ret = wcswidth(s, n);
|
||||
return max(0, ret);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue