tboegi@xxxxxx writes: > The choosen solution is to split code in diff.c like this > > strbuf_addf(&out, "%-*s", len, name); > > into 2 calls, like this: > > strbuf_addf(&out, "%s", name); > if (len > utf8_strwidth(name)) > strbuf_addchars(&out, ' ', len - utf8_strwidth(name)); Makes sense. Is utf8_strwidth(name) cheap enough that we can call it twice in a row on the same string casually, or should we avoid it with a new variable? It might be worth doing a helper function, even? static inline strbuf_pad(struct strbuf *out, const char *s, size_t width) { size_t w = utf8_strwidth(s); strbuf_addstr(out, s); if (w < width) strbuf_addchars(out, ' ', width - w); } Other than that, sounds very sensible.