]> git.lyx.org Git - features.git/commitdiff
finally commit the fix for #7607.
authorJürgen Spitzmüller <spitz@lyx.org>
Sat, 17 Sep 2011 15:25:14 +0000 (15:25 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sat, 17 Sep 2011 15:25:14 +0000 (15:25 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39696 a592a061-630c-0410-9148-cb99ea01b6c8

src/output_latex.cpp

index c2ec939d7ed6ef4ddc32fb7915ef13195d7d604c..0b3580875d57223f2675723cd28d5d063b2bb5c8 100644 (file)
@@ -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)