--- src/text.c (revision 5238) +++ src/text.c (working copy) @@ -501,6 +501,10 @@ #endif /* !DISABLE_WRAPPING */ case JOIN: undidmsg = _("line join"); + + if (ISSET(NO_NEWLINES) || f->next != openfile->filebot || + openfile->filebot->data[0] != '\0' || u->strdata[0] != '\0') + { t = make_new_node(f); t->data = mallocstrcpy(NULL, u->strdata); data = mallocstrncpy(NULL, f->data, u->mark_begin_x + 1); @@ -510,6 +514,7 @@ splice_node(f, t, f->next); if (f == openfile->filebot) openfile->filebot = t; + } goto_line_posx(u->lineno, u->begin); break; case CUT_EOF: