From: Juergen Spitzmueller Date: Thu, 4 Jan 2018 17:38:08 +0000 (+0100) Subject: Do note attempt to nest more than possible. X-Git-Tag: 2.3.0rc2~93 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=cf97ec4a21e7b44de710d33df8aa8522c6f98651;p=features.git Do note attempt to nest more than possible. (cherry picked from commit 32efb914384392426a4d909d1650edff727d8f15) --- diff --git a/src/Text3.cpp b/src/Text3.cpp index 36ab593910..1333570813 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1554,8 +1554,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) if ((outer || normal) && nextpar_depth > 0) { // restore nesting of following paragraph DocIterator scur = cur; + depth_type const max_depth = cur.paragraph().getMaxDepthAfter(); cur.forwardPar(); - while (cur.paragraph().params().depth() < nextpar_depth) + while (cur.paragraph().params().depth() <= min(nextpar_depth, max_depth)) lyx::dispatch(FuncRequest(LFUN_DEPTH_INCREMENT)); cur.setCursor(scur); }