CursorSlice & bot = cursor_.bottom();
TextMetrics & tm = text_metrics_[bot.text()];
pit_type const pit = bot.pit();
- int max_width = workWidth();
tm.redoParagraph(pit);
ParagraphMetrics const & pm = tm.parMetrics(pit);
anchor_ref_ = pit;
}
+bool BufferView::checkDepm(LCursor & cur, LCursor & old)
+{
+ // Would be wrong to delete anything if we have a selection.
+ if (cur.selection())
+ return false;
+
+ bool need_anchor_change = false;
+ bool changed = cursor_.text()->deleteEmptyParagraphMechanism(cur, old,
+ need_anchor_change);
+
+ if (need_anchor_change)
+ cur.resetAnchor();
+
+ if (!changed)
+ return false;
+
+ updateMetrics(false);
+ buffer_->changed();
+ return true;
+}
+
+
bool BufferView::mouseSetCursor(LCursor & cur)
{
BOOST_ASSERT(&cur.bv() == this);
// FIXME: move this to InsetText::notifyCursorLeaves?
bool update = false;
if (!badcursor && cursor_.inTexted())
- update = cursor_.text()->deleteEmptyParagraphMechanism(cur, cursor_);
+ checkDepm(cur, cursor_);
cursor_ = cur;
cursor_.clearSelection();