]> git.lyx.org Git - features.git/commitdiff
Another case where nesting needs to be preserved.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 31 Dec 2017 13:43:45 +0000 (14:43 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 31 Dec 2017 13:43:45 +0000 (14:43 +0100)
src/Text3.cpp

index 0c48da2b7ce760471c8c55f69b2873a88419884c..daa8912317e075ccb319bd82b14f2f82038fbce7 100644 (file)
@@ -1505,6 +1505,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                bool const outer = cmd.argument() == "outer";
                bool const previous = cmd.argument() == "previous";
                bool const before = cmd.argument() == "before";
+               bool const normal = cmd.argument().empty();
                Paragraph const & para = cur.paragraph();
                docstring layout;
                if (para.layout().isEnvironment())
@@ -1533,11 +1534,11 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                                if (cpar.params().depth() == 0)
                                        break;
                        }
-                       if (outer && cur.pit() < cur.lastpit()) {
-                               // save nesting of following paragraph
-                               cpar = pars_[cur.pit() + 1];
-                               nextpar_depth = cpar.params().depth();
-                       }
+               }
+               if ((outer || normal) && cur.pit() < cur.lastpit()) {
+                       // save nesting of following paragraph
+                       Paragraph cpar = pars_[cur.pit() + 1];
+                       nextpar_depth = cpar.params().depth();
                }
                if (before)
                        cur.top().setPitPos(cur.pit(), 0);
@@ -1562,7 +1563,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                else
                        lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_BREAK, "inverse"));
                lyx::dispatch(FuncRequest(LFUN_LAYOUT, layout));
-               if (outer && nextpar_depth > 0) {
+               if ((outer || normal) && nextpar_depth > 0) {
                        // restore nesting of following paragraph
                        DocIterator scur = cur;
                        cur.forwardPar();