X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fdociterator.C;h=565a43f8945f26ca1f81e5ed50c36953cf378433;hb=37d42d45f3f4a5d3e916a080af50b37ae4a9d118;hp=0b3e0567ec476da5f79e0194247707858ceccd6b;hpb=f200823716565c4c37046f32daca40eaf70223dc;p=lyx.git diff --git a/src/dociterator.C b/src/dociterator.C index 0b3e0567ec..565a43f894 100644 --- a/src/dociterator.C +++ b/src/dociterator.C @@ -289,7 +289,7 @@ InsetBase * DocIterator::innerInsetOfType(int code) const } -void DocIterator::forwardPos() +void DocIterator::forwardPos(bool ignorecollapsed) { //this dog bites his tail if (empty()) { @@ -297,6 +297,15 @@ void DocIterator::forwardPos() return; } + // jump over collapsables if they are collapsed + // FIXME: the check for asMathInset() shouldn't be necessary + // but math insets do not return a sensible editable() state yet. + if (ignorecollapsed && nextInset() && (!nextInset()->asMathInset() + && nextInset()->editable() != InsetBase::HIGHLY_EDITABLE)) { + ++top().pos(); + return; + } + CursorSlice & tip = top(); //lyxerr << "XXX\n" << *this << endl;