]> git.lyx.org Git - features.git/commitdiff
Mark follow-up paragraphs in a paragraph group as nested.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 31 Dec 2017 09:37:35 +0000 (10:37 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 31 Dec 2017 09:37:35 +0000 (10:37 +0100)
This gives a more consistent indication of what belongs to an environment
(and semantically, such paragraphs are synonymous to nested standard
paragraphs)

Addresses part of #9261.

src/RowPainter.cpp

index 6fbc783b358c47c50a1ecbe9cd5b3a4ff1d92aef..69b480d185ba8ce9b547b64da65d7588e45e4d48 100644 (file)
@@ -272,7 +272,12 @@ void RowPainter::paintAppendix() const
 
 void RowPainter::paintDepthBar() const
 {
-       depth_type const depth = par_.getDepth();
+       depth_type depth = par_.getDepth();
+
+       // We also mark follow-up paragraphs in a paragraph group
+       if (par_.layout().isParagraphGroup()
+           && !text_.isFirstInSequence(row_.pit()))
+               ++depth;
 
        if (depth <= 0)
                return;
@@ -283,6 +288,10 @@ void RowPainter::paintDepthBar() const
                if (row_.pos() == 0)
                        --pit2;
                prev_depth = pars_[pit2].getDepth();
+               // We also mark follow-up paragraphs in a paragraph group
+               if (pars_[pit2].layout().isParagraphGroup()
+                   && !text_.isFirstInSequence(pit2))
+                       ++prev_depth;
        }
 
        depth_type next_depth = 0;
@@ -291,6 +300,10 @@ void RowPainter::paintDepthBar() const
                if (row_.endpos() >= pars_[pit2].size())
                        ++pit2;
                next_depth = pars_[pit2].getDepth();
+               // We also mark follow-up paragraphs in a paragraph group
+               if (pars_[pit2].layout().isParagraphGroup()
+                   && !text_.isFirstInSequence(pit2))
+                       ++next_depth;
        }
 
        for (depth_type i = 1; i <= depth; ++i) {