From: Juergen Spitzmueller Date: Sun, 31 Dec 2017 13:43:45 +0000 (+0100) Subject: Another case where nesting needs to be preserved. X-Git-Tag: lyx-2.4.0dev-acb2ca7b~4100 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=99ae8d58c81382f9df80bd338bdfebae55fb2742;p=features.git Another case where nesting needs to be preserved. --- diff --git a/src/Text3.cpp b/src/Text3.cpp index 0c48da2b7c..daa8912317 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -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();