From 889dac7def8036a86cc6ecbac151c34d6cc47b07 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Wed, 28 Jun 2023 14:46:46 +0200 Subject: [PATCH] Prevent par break caused by \egroup (#12821) --- src/insets/InsetListings.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index 5afc432726..f2b26f0d15 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -409,6 +409,10 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const // Switch back switchEncoding(os.os(), buffer().params(), runparams, *save_enc, true, true); + if (!isInline) + // Go out of vertical mode. Otherwise \egroup + // causes a paragraph break (#12821) + os << "\\leavevmode"; os << "\\egroup" << breakln; runparams.encoding = save_enc; } -- 2.39.5