diff --git a/src/BufferView.cpp b/src/BufferView.cpp index e94d08e60f..d5ee51739c 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1802,6 +1802,10 @@ void BufferView::updateMetrics() if (d->inlineCompletionPos.fixIfBroken()) d->inlineCompletionPos = DocIterator(); + if (d->anchor_pit_ >= npit) + // The anchor pit must have been deleted... + d->anchor_pit_ = npit - 1; + // Rebreak anchor paragraph. tm.redoParagraph(d->anchor_pit_); ParagraphMetrics & anchor_pm = tm.par_metrics_[d->anchor_pit_];