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 --- terminal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 45c6c98b..83406f41 100644 --- a/terminal.h +++ b/terminal.h @@ -87,6 +87,7 @@ struct damage { struct composed { wchar_t chars[20]; uint8_t count; + int width; }; struct row_uri_range { -- cgit v1.3