X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FText3.cpp;h=b86819b237328f2762118890de3664f91bb40286;hb=05282ceeec5fc9872f73f7de93136fc218f8ecb4;hp=2158128891b220ad0650960e597283a993f0b2fd;hpb=741d81ecc6d029425b4fea6815cdbb49cc7dc857;p=lyx.git diff --git a/src/Text3.cpp b/src/Text3.cpp index 2158128891..b86819b237 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1654,8 +1654,13 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) DocIterator scur = cur; depth_type const max_depth = cur.paragraph().params().depth() + 1; cur.forwardPar(); - while (cur.paragraph().params().depth() < min(nextpar_depth, max_depth)) + while (cur.paragraph().params().depth() < min(nextpar_depth, max_depth)) { + depth_type const olddepth = cur.paragraph().params().depth(); lyx::dispatch(FuncRequest(LFUN_DEPTH_INCREMENT)); + if (olddepth == cur.paragraph().params().depth()) + // leave loop if no incrementation happens + break; + } cur.setCursor(scur); }