]> git.lyx.org Git - features.git/commitdiff
Fix bug 2768 (inset comment eats space after it)
authorBo Peng <bpeng@lyx.org>
Tue, 15 Aug 2006 15:12:26 +0000 (15:12 +0000)
committerBo Peng <bpeng@lyx.org>
Tue, 15 Aug 2006 15:12:26 +0000 (15:12 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14692 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/insetnote.C

index 3437fb12fb4ef16d117e2bbd55fa26b245272fa1..0fec72f0d0101eea3af0c03428672d0bfddfa1ed 100644 (file)
@@ -265,7 +265,20 @@ int InsetNote::latex(Buffer const & buf, ostream & os,
        ostringstream ss;
        ss << "%\n\\begin{" << type << "}\n";
        InsetText::latex(buf, ss, runparams);
-       ss << "%\n\\end{" << type << "}\n";
+       ss << "\n\\end{" << type << "}\n";
+       // the space after the comment in 'a[comment] b' will be eaten by the
+       // comment environment since the space before b is ignored with the
+       // following latex output:
+       //
+       // a%
+       // \begin{comment}
+       // comment
+       // \end{comment}
+       //  b
+       //
+       // Adding {} before ' b' fixes this.
+       if (params_.type == InsetNoteParams::Comment)
+               ss << "{}";
 
        string const str = ss.str();
        os << str;