From 5118d369e104710e3508e22cfd209e36c5261666 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Sat, 17 Sep 2011 15:25:14 +0000 Subject: [PATCH] finally commit the fix for #7607. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39696 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/output_latex.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/output_latex.cpp b/src/output_latex.cpp index c2ec939d7e..0b3580875d 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -719,6 +719,7 @@ void TeXOnePar(Buffer const & buf, } bool pending_newline = false; + bool unskip_newline = false; switch (style.latextype) { case LATEX_ITEM_ENVIRONMENT: case LATEX_LIST_ENVIRONMENT: @@ -792,6 +793,7 @@ void TeXOnePar(Buffer const & buf, "$$lang", current_lang)); pending_newline = true; + unskip_newline = true; } } else if (!par_lang.empty()) { os << from_ascii(subst( @@ -799,14 +801,19 @@ void TeXOnePar(Buffer const & buf, "$$lang", par_lang)); pending_newline = true; + unskip_newline = true; } } } if (closing_rtl_ltr_environment) os << "}"; - if (pending_newline) + if (pending_newline) { + if (unskip_newline) + // prevent unwanted whitespace + os << '%'; os << '\n'; + } // if this is a CJK-paragraph and the next isn't, close CJK // also if the next paragraph is a multilingual environment (because of nesting) -- 2.39.2