Jean-Marc Lasgouttes wrote: > Well, the first change is straight forward,
Right. See attached patch. > but I do not know what is > the right semantics to use for the second problem. Me neither. Jürgen
Index: src/Text3.cpp =================================================================== --- src/Text3.cpp (Revision 23533) +++ src/Text3.cpp (Arbeitskopie) @@ -272,6 +272,8 @@ lyx::dispatch(FuncRequest(LFUN_CUT)); gotsel = true; } + bool const emptypar = cur.lastpos() == 0; + pos_type ins_pos = cur.pos(); text->insertInset(cur, inset); if (edit) @@ -281,8 +283,8 @@ // metrics might be invalid at this point (bug 4502) cur.bv().updateMetrics(); lyx::dispatch(FuncRequest(LFUN_PASTE, "0")); - - if (cur.lastpit() == 0) { + + if ((cur.lastpit() == 0 || ins_pos != 0) && !emptypar) { // reset first par to default Layout_ptr const layout = cur.buffer().params().getTextClass().defaultLayout();