}
+bool BufferView::Pimpl::multiParSel()
+{
+ if (!cursor_.selection())
+ return false;
+ bool ret = multiparsel_cache_;
+ multiparsel_cache_ = cursor_.selBegin().pit() != cursor_.selEnd().pit();
+ // Either this, or previous selection spans paragraphs
+ return ret || multiparsel_cache_;
+}
+
+
void BufferView::Pimpl::update(Update::flags flags)
{
lyxerr[Debug::DEBUG]
// First drawing step
ViewMetricsInfo vi = metrics(flags & Update::SinglePar);
- bool forceupdate(flags & Update::Force);
+ bool forceupdate(flags & (Update::Force | Update::SinglePar));
if ((flags & Update::FitCursor) && fitCursor()) {
forceupdate = true;
vi = metrics();
}
+ if ((flags & Update::MultiParSel) && multiParSel()) {
+ forceupdate = true;
+ vi = metrics();
+ }
if (forceupdate) {
// Second drawing step
screen().redraw(*bv_, vi);
buffer_->undostack().clear();
} else {
cursor_.setCursor(doc_iterator_begin(buffer_->inset()));
- bool const found = lyx::find::findNextChange(bv_);
- if (found) {
- // We reset the cursor to the start of the
- // document, since the Changes Dialog is going
- // to search for the next change anyway.
- cursor_.setCursor(doc_iterator_begin(buffer_->inset()));
+ if (lyx::find::findNextChange(bv_)) {
owner_->getDialogs().show("changes");
return;
}
if (cur.result().update())
update(Update::FitCursor | Update::Force);
else
- update();
+ update(Update::FitCursor | Update::MultiParSel);
}
// See workAreaKeyPress
}
case LFUN_MERGE_CHANGES:
- owner_->getDialogs().show("changes");
+ if (lyx::find::findNextChange(bv_))
+ owner_->getDialogs().show("changes");
break;
case LFUN_ACCEPT_ALL_CHANGES: {