<< "[ b = " << b << "]" << endl;
if (buffer_) {
+ // Save the current selection if any
+ cap::saveSelection(cursor_);
// Save the actual cursor position and anchor inside the
// buffer so that it can be restored in case we rechange
// to this buffer later on.
{
BOOST_ASSERT(&cur.bv() == this);
+ // this event will clear selection so we save selection for
+ // persistent selection
+ cap::saveSelection(cursor());
+
// Has the cursor just left the inset?
bool badcursor = false;
bool leftinset = (&cursor_.inset() != &cur.inset());
if (leftinset)
- badcursor = cursor_.inset().notifyCursorLeaves(cursor_);
+ badcursor = notifyCursorLeaves(cursor_, cur);
// do the dEPM magic if needed
// FIXME: (1) move this to InsetText::notifyCursorLeaves?
cursor_.setSelection(cursor_, -length);
} else
cursor_.setSelection(cursor_, length);
- cap::saveSelection(cursor_);
}
}
offset_ref_ = 0;
}
+ if (!singlepar) {
+ // Clear out the position cache in case of full screen redraw,
+ coord_cache_.clear();
+
+ // Clear out paragraph metrics to avoid having invalid metrics
+ // in the cache from paragraphs not relayouted below
+ tm.clear();
+ }
+
// If the paragraph metrics has changed, we can not
// use the singlepar optimisation.
if (singlepar
if (!singlepar)
tm.redoParagraph(pit);
- // Clear out the position cache in case of full screen redraw.
- if (!singlepar)
- coord_cache_.clear();
-
int y0 = tm.parMetrics(pit).ascent() - offset_ref_;
// Redo paragraphs above anchor if necessary.