Status line fixes: don't truncate status-right now the length calculation is

done for UTF-8, limit to the maximum length correctly when printing, and always
print a space even if the left string is longer than the width available.
This commit is contained in:
Nicholas Marriott
2009-06-26 15:34:12 +00:00
parent 3fcbe1e27b
commit de2ea2d178
4 changed files with 8 additions and 9 deletions

View File

@ -164,7 +164,7 @@ screen_write_vnputs(struct screen_write_ctx *ctx, ssize_t maxlen,
gc->flags &= ~GRID_FLAG_UTF8;
} else {
if (maxlen > 0 && size > (size_t) maxlen)
if (maxlen > 0 && size + 1 > (size_t) maxlen)
break;
size++;