X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText.cpp;h=19b3af5b28b2a272a1f50726f5a57313346893eb;hb=5366666c831b6ad726e848a60d738b57ec8b0501;hp=1f8288a71dbe985a8c05a263d2e74098835fe2b1;hpb=18f7dce3d9877c690f3d4dbb0239a816e1d42414;p=lyx.git diff --git a/src/Text.cpp b/src/Text.cpp index 1f8288a71d..19b3af5b28 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -1950,10 +1950,13 @@ bool Text::splitInset(Cursor & cur) cur.setMark(false); cur.selHandle(false); cur.resetAnchor(); - Cursor dummy = cur; - dummy.pos() = dummy.pit() = 0; - if (cur.bv().checkDepm(dummy, cur)) + bool atlastpos = false; + if (cur.pos() == 0 && cur.pit() > 0) { + // if we are at par start, remove this par + cur.text()->backspace(cur); cur.forceBufferUpdate(); + } else if (cur.pos() == cur.lastpos()) + atlastpos = true; // Move out of and jump over inset cur.popBackward(); ++cur.pos(); @@ -1966,6 +1969,11 @@ bool Text::splitInset(Cursor & cur) cutSelection(cur, false); cap::pasteFromTemp(cur, cur.buffer()->errorList("Paste")); cur.text()->setCursor(cur, 0, 0); + if (atlastpos && cur.paragraph().isFreeSpacing() && cur.paragraph().empty()) { + // We started from par end, remove extra empty par in free spacing insets + cur.text()->erase(cur); + cur.forceBufferUpdate(); + } } cur.finishUndo();