row->next()->previous(row->previous());
if (!row->previous()) {
firstrow = row->next();
+// lyx::Assert(firstrow);
} else {
row->previous()->next(row->next());
}
void LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
LyXCursor const & old_cursor) const
{
+ // don't delete anything if this is the ONLY paragraph!
+ if (!old_cursor.par()->next() && !old_cursor.par()->previous())
+ return;
+
// Would be wrong to delete anything if we have a selection.
if (selection.set()) return;
// We allow all kinds of "mumbo-jumbo" when freespacing.
if (textclasslist.Style(bview->buffer()->params.textclass,
- old_cursor.par()->getLayout()).free_spacing)
+ old_cursor.par()->getLayout()).free_spacing ||
+ old_cursor.par()->isFreeSpacing())
+ {
return;
+ }
bool deleted = false;