bool Cursor::inCoordCache() const
{
+ // the root inset is not in cache, but we do not need it.
+ if (depth() == 1)
+ return true;
CoordCache::Insets const & icache = bv_->coordCache().getInsets();
- for (size_t i = 0 ; i < depth() ; ++i)
+ for (size_t i = 1 ; i < depth() ; ++i)
if (!icache.has(&(*this)[i].inset()))
return false;
return true;
// LASSERT: There have been several bugs around this code, that seem
// to involve failures to reset the anchor. We can at least not crash
// in release mode by resetting it ourselves.
- LASSERT(anchor_.depth() >= depth(),
- const_cast<DocIterator &>(anchor_) = *this);
+ if (anchor_.depth() < depth()) {
+ LYXERR0("Cursor is deeper than anchor. PLEASE REPORT.\nCursor is"
+ << *this);
+ const_cast<DocIterator &>(anchor_) = *this;
+ }
CursorSlice normal = anchor_[depth() - 1];
if (depth() < anchor_.depth() && top() <= normal) {
// In case the master has no gui associated with it,
// the TocItem is not updated (part of bug 5699).
buffer()->tocBackend().updateItem(*this);
+
+ // If the last tracked change of the paragraph has just been
+ // deleted, then we need to recompute the buffer flag
+ // tracked_changes_present_.
+ if (inTexted() && paragraph().isChangeUpdateRequired())
+ disp_.forceChangesUpdate();
}