Mercurial > hg > mlmmj
changeset 868:e3d4c5986628
Ensure we don't wrap prematurely and insert an unwanted blank line.
This could happen when the space was inserted between lines: it could trigger
wrapping before there was actually an overflow.
author | Ben Schmidt |
---|---|
date | Tue, 20 Mar 2012 10:43:01 +1100 |
parents | 1a3c00132077 |
children | d4707be29c14 |
files | src/prepstdreply.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/prepstdreply.c Tue Mar 13 12:06:42 2012 +1100 +++ b/src/prepstdreply.c Tue Mar 20 10:43:01 2012 +1100 @@ -1273,7 +1273,8 @@ inhibitbreak = 0; while (*pos != '\0') { if (txt->wrapwidth != 0 && width >= txt->wrapwidth && - !peeking && linebreak > wrapindentlen) + !peeking && linebreak > wrapindentlen && + linebreak < len) break; if ((unsigned char)*pos > 0xbf && txt->skip == NULL && txt->wrapmode == WRAP_CHAR && @@ -1458,7 +1459,8 @@ if (txt->wrapwidth != 0 && !peeking) { if (width < txt->wrapwidth || - linebreak <= wrapindentlen) { + linebreak <= wrapindentlen || + linebreak >= len) { prev = line; continue; }