http://bugzilla.lyx.org/show_bug.cgi?id=3624
The attached patch solves this an an associate problem. It's just an expansion of the fix to bug 3146 (which was the same for ERT). OK to go in when trunk is open again (is it?)? Jürgen
Index: src/Cursor.cpp =================================================================== --- src/Cursor.cpp (Revision 18396) +++ src/Cursor.cpp (Arbeitskopie) @@ -249,8 +249,9 @@ { odocstringstream ods; ods << '\n'; - // only add blank line if we're not in an ERT inset - if (par.ownerCode() != Inset::ERT_CODE) + // only add blank line if we're not in an ERT or Listings inset + if (par.ownerCode() != Inset::ERT_CODE + && par.ownerCode() != Inset::LISTINGS_CODE) ods << '\n'; return ods.str(); } Index: src/TextMetrics.cpp =================================================================== --- src/TextMetrics.cpp (Revision 18396) +++ src/TextMetrics.cpp (Arbeitskopie) @@ -669,6 +669,7 @@ if (bufparams.paragraph_separation == BufferParams::PARSEP_SKIP && par.ownerCode() != Inset::ERT_CODE + && par.ownerCode() != Inset::LISTINGS_CODE && pit > 0 && ((layout->isParagraph() && par.getDepth() == 0) || (pars[pit - 1].layout()->isParagraph()