diff --git a/src/Text3.cpp b/src/Text3.cpp index cb7efab34a..a8611fc8f7 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -281,11 +281,18 @@ bool doInsertInset(Cursor & cur, Text * text, // metrics might be invalid at this point (bug 4502) cur.bv().updateMetrics(); lyx::dispatch(FuncRequest(LFUN_PASTE, "0")); - // reset first par to default - if (cur.lastpit() != 0 || cur.lastpos() != 0) { + + if (cur.lastpit() == 0) { + // reset first par to default Layout_ptr const layout = cur.buffer().params().getTextClass().defaultLayout(); cur.text()->paragraphs().begin()->layout(layout); + } else { + // reset surrounding par to default + docstring const layoutname = + cur.buffer().params().getTextClass().defaultLayoutName(); + cur.leaveInset(*inset); + text->setLayout(cur, layoutname); } } return true; diff --git a/status.15x b/status.15x index a4a8ca8273..d1e7a7dbf8 100644 --- a/status.15x +++ b/status.15x @@ -77,6 +77,9 @@ What's new - When cutting a selection do not leave a dangling paragraph (bug 3995). +- Improve the behaviour when inserting a collapsable inset over a multi- + paragraph selection. + * DOCUMENTATION