From 0a9531ac6caff2ad6abfbb804ec27cade4a92e7a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Thu, 27 May 2021 20:07:28 +0200 Subject: vt: cache grapheme cluster width in composed struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 --- util.h | 8 -------- 1 file changed, 8 deletions(-) (limited to 'util.h') diff --git a/util.h b/util.h index af215111..aa9fc8ba 100644 --- a/util.h +++ b/util.h @@ -35,11 +35,3 @@ sdbm_hash(const char *s) return hash; } - -#include -static inline int -my_wcswidth(const wchar_t *s, size_t n) -{ - int ret = wcswidth(s, n); - return max(0, ret); -} -- cgit v1.3