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:13:39 +00:00
parent c506e7f711
commit 1ec736a3dc
2 changed files with 5 additions and 6 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++;