--- joe-3.1/uformat.c 2004-05-24 22:45:36.000000000 +0200 +++ uformat.c 2004-12-21 13:15:49.713747736 +0100 @@ -313,37 +313,41 @@ /* If we found the beginning of a word... */ if (!pisbol(p) && piscol(p) > indent) { /* Move q to two (or one if 'french' is set) spaces after end of previous word */ q = pdup(p); while (!pisbol(q)) if (!joe_isblank(p->b->o.charmap, (c = prgetc(q)))) { pgetc(q); if ((c == '.' || c == '?' || c == '!') && q->byte != p->byte && !french) pgetc(q); break; } pgetc(p); - /* Delete space between start of word and end of previous word */ - to -= p->byte - q->byte; - bdel(q, p); - prm(q); + if ((!p->b->o.overtype) || p->line == p->hdr->nlines) + { + /* Delete space between start of word and end of previous word */ + to -= p->byte - q->byte; + bdel(q, p); + prm(q); + + /* Move word to beginning of next line */ + binsc(p, '\n'); + } - /* Move word to beginning of next line */ - binsc(p, '\n'); ++to; if (p->b->o.crlf) ++to; pgetc(p); /* Indent to left margin */ if (indents) { binss(p, indents); to += strlen((char *)indents); } else while (indent--) { binsc(p, ' '); ++to; }