diff options
| author | Simon Tatham <anakin@pobox.com> | 1999-10-24 17:14:16 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 1999-10-24 17:14:16 +0000 |
| commit | 8e0e3ac1481ea8c84aa2a0dbfb23bbb3d7700a0c (patch) | |
| tree | b93bc282935b99bb8176c91784a7d61d35925222 /misc.c | |
| parent | 3cb5a6f58a56ca01547558e7b4543bf98fc25e1b (diff) | |
| download | halibut-8e0e3ac1481ea8c84aa2a0dbfb23bbb3d7700a0c.zip halibut-8e0e3ac1481ea8c84aa2a0dbfb23bbb3d7700a0c.tar.gz halibut-8e0e3ac1481ea8c84aa2a0dbfb23bbb3d7700a0c.tar.bz2 halibut-8e0e3ac1481ea8c84aa2a0dbfb23bbb3d7700a0c.tar.xz | |
Macros; \- for nonbreaking hyphen
[originally from svn r252]
Diffstat (limited to 'misc.c')
| -rw-r--r-- | misc.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -172,7 +172,8 @@ wrappedline *wrap_para(word *text, int width, int subsequentwidth, while (text) { thiswidth += widthfn(text); if (text->next && (text->next->type == word_WhiteSpace || - text->next->type == word_EmphSpace)) { + text->next->type == word_EmphSpace || + text->breaks)) { if (thiswidth > width) break; spc = text->next; @@ -192,8 +193,7 @@ wrappedline *wrap_para(word *text, int width, int subsequentwidth, * anyway as the best we can do. */ if (spc && thiswidth > width) { - w->end = spc; - text = spc->next; + w->end = text = spc; w->nspaces = nspc-1; w->shortfall = width - lastgood; } else if (!text) { @@ -202,10 +202,15 @@ wrappedline *wrap_para(word *text, int width, int subsequentwidth, w->shortfall = width - thiswidth; } else { w->end = text; - text = text->next; w->nspaces = 0; w->shortfall = width - thiswidth; } + /* + * Skip the space if we're on one. + */ + if (text && (text->type == word_WhiteSpace || + text->type == word_EmphSpace)) + text = text->next; width = subsequentwidth; } |