]> git.lyx.org Git - lyx.git/commitdiff
Fix bug 3052: Always start a new paragraph after a noweb code chunk
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 2 Jan 2007 12:35:53 +0000 (12:35 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Tue, 2 Jan 2007 12:35:53 +0000 (12:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16467 a592a061-630c-0410-9148-cb99ea01b6c8

src/tex2lyx/text.C

index 8b169b2167ed72817fb63c9f8efd730378fe5e01..2f7740686faf04eea94d3693aee58b084fdeb0f4 100644 (file)
@@ -1055,7 +1055,13 @@ void parse_noweb(Parser & p, ostream & os, Context & context)
                return;
        }
 
-       context.check_end_layout(os);
+       // We use new_paragraph instead of check_end_layout because the stuff
+       // following the noweb chunk needs to start with a \begin_layout.
+       // This may create a new paragraph even if there was none in the
+       // noweb file, but the alternative is an invalid LyX file. Since
+       // noweb code chunks are implemented with a layout style in LyX they
+       // always must be in an own paragraph.
+       context.new_paragraph(os);
        Context newcontext(true, context.textclass, context.textclass["Scrap"]);
        newcontext.check_layout(os);
        os << name;