LYXERR(Debug::DEBUG, "Cursor::dispatch: (AtPoint) cmd: "
<< cmd0 << endl << *this);
nextInset()->dispatch(*this, tmpcmd);
- if (result().dispatched())
+ if (result().dispatched()) {
+ buffer()->undo().endUndoGroup();
return;
+ }
}
// store some values to be used inside of the handlers
cap::eraseSelection(*this);
cell().insert(pos(), ar);
pos() += ar.size();
+ // FIXME audit setBuffer/updateLabels calls
+ inset().setBuffer(bv_->buffer());
}
bool Cursor::fixIfBroken()
{
- if (DocIterator::fixIfBroken()) {
- clearSelection();
- return true;
+ bool const broken_cursor = DocIterator::fixIfBroken();
+ bool const broken_anchor = anchor_.fixIfBroken();
+
+ if (broken_cursor || broken_anchor) {
+ clearSelection();
+ return true;
}
return false;
}