Refactor UTF-8 chopping

Add a function that makes sure a string does not exceed a given display
size. If the string is too long, dots ("...") are appended.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-02-25 21:48:39 +01:00
parent 85772d746f
commit c34f9aba29
4 changed files with 36 additions and 21 deletions

View File

@@ -1090,6 +1090,7 @@ void ui_todo_set_view(int);
/* utf8.c */
int utf8_width(char *);
int utf8_strwidth(char *);
int utf8_chop(char *, int);
/* utils.c */
void exit_calcurse(int) __attribute__ ((__noreturn__));