wordwrap one char earlier

This commit is contained in:
Sascha Kruse 2013-02-18 22:36:23 +00:00
parent 62e92c7625
commit f0c9b71b97

View File

@ -669,7 +669,7 @@ GSList *do_word_wrap(char *text, int max_width)
begin = ++end; begin = ++end;
} }
if (word_wrap && max_width > 0 && textnw(dc, begin, (end - begin)) > max_width) { if (word_wrap && max_width > 0 && textnw(dc, begin, (end - begin) + 1) > max_width) {
/* find previous space */ /* find previous space */
char *space = end; char *space = end;
while (space > begin && !isspace(*space)) while (space > begin && !isspace(*space))