From 3cea78b00dcebe76da9a69d58c33c8b2a58d41ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 24 May 2016 21:39:58 +0200 Subject: Add utility function to calculate display width of a string This is based on the implementation of text_line_width_get from text-motions.c. There might be an opportunity for code sharing. --- text-util.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'text-util.h') diff --git a/text-util.h b/text-util.h index a4d31b1..86d3307 100644 --- a/text-util.h +++ b/text-util.h @@ -23,5 +23,7 @@ bool text_range_overlap(const Filerange*, const Filerange*); bool text_range_contains(const Filerange*, size_t pos); /* count the number of graphemes in data */ int text_char_count(const char *data, size_t len); +/* get the approximate display width of data */ +int text_string_width(const char *data, size_t len); #endif -- cgit v1.2.3