aboutsummaryrefslogtreecommitdiff
path: root/text-util.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-24 21:39:58 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-24 21:39:58 +0200
commit3cea78b00dcebe76da9a69d58c33c8b2a58d41ed (patch)
treec23f89a8eafe1b7547ebdf57c6b01701d709b0bc /text-util.h
parent9bcfd3f83098dcd4246b95fc37d523e06129ed12 (diff)
downloadvis-3cea78b00dcebe76da9a69d58c33c8b2a58d41ed.tar.gz
vis-3cea78b00dcebe76da9a69d58c33c8b2a58d41ed.tar.xz
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.
Diffstat (limited to 'text-util.h')
-rw-r--r--text-util.h2
1 files changed, 2 insertions, 0 deletions
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