}
-void DocIterator::forwardPos()
+void DocIterator::forwardPos(bool ignorecollapsed)
{
//this dog bites his tail
if (empty()) {
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;
}
//lyxerr << "... no next idx" << endl;
- // otherwise we can't move on
+ // otherwise leave inset and jump over inset as a whole
+ pop_back();
+ // 'top' is invalid now...
+ if (!empty())
+ ++top().pos();
}
}
-void DocIterator::updateInsets(InsetBase * inset)
+void DocIterator::updateInsets(InsetBase * inset)
{
// this function re-creates the cache of inset pointers.
// code taken in part from StableDocIterator::asDocIterator.
{
return dit1.data_ == dit2.data_;
}
-