From e0dfcdbdda3f233dc66e45b29f8503495628053a Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Mon, 24 Jan 2011 23:58:58 +0000 Subject: [PATCH] Fix bug #7254 (LyX may insert a blank line when ending an environment) The quick solution is to output a % sign before \n. The better one would be doing as in mathed, but it is not so straightforward. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37320 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/insets/InsetFloat.cpp | 4 ++-- src/insets/InsetText.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index 2292d175c9..7e8bb7f7de 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -386,8 +386,8 @@ int InsetFloat::latex(odocstream & os, OutputParams const & runparams_in) const int const i = InsetText::latex(os, runparams); // The \n is used to force \end{} to appear in a new line. - // In this case, we do not case if the current output line is empty. - os << "\n\\end{" << from_ascii(tmptype) << "}\n"; + // Also in this case, we care that the current output line is not empty. + os << "%\n\\end{" << from_ascii(tmptype) << "}\n"; return i + 4; } diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp index ea4273fe32..3805e836bc 100644 --- a/src/insets/InsetText.cpp +++ b/src/insets/InsetText.cpp @@ -413,7 +413,7 @@ int InsetText::latex(odocstream & os, OutputParams const & runparams) const if (il.latextype() == InsetLayout::COMMAND) { os << "}"; } else if (il.latextype() == InsetLayout::ENVIRONMENT) { - os << "\n\\end{" << from_utf8(il.latexname()) << "}\n"; + os << "%\n\\end{" << from_utf8(il.latexname()) << "}\n"; rows += 2; } } -- 2.39.2