With a little luck, this should be the final tweak for
our support of extra wide characters. Currently, those
characters don't always display the '+' indicator when
they've been truncated. Now, it should always be seen.
[ plus it's done a tad more efficiently via snprintf ]
Signed-off-by: Jim Warner <james.warner@comcast.net>
int delta = utf8_delta(str);
if (width + delta < snprintf(buf, sizeof(buf), "%s", str)) {
- snprintf(buf, sizeof(buf), "%.*s", utf8_embody(str, width - 1), str);
+ snprintf(buf, sizeof(buf), "%.*s%c", utf8_embody(str, width-1), str, COLPLUSCH);
delta = utf8_delta(buf);
- buf[width + delta - 1] = COLPLUSCH;
AUTOX_COL(col);
}
return justify_pad(buf, width + delta, justr);