cursor_.push(buffer_->inset());
cursor_.resetAnchor();
buffer_->text().setCurrentFont(cursor_);
+
+ // Update the metrics now that we have a proper Cursor.
+ updateMetrics(false);
+
+ // FIXME: This code won't be needed once we switch to
+ // "one Buffer" / "one BufferView".
if (buffer_->getCursor().size() > 0 &&
buffer_->getAnchor().size() > 0)
{
// Make sure that the restored cursor is not broken. This can happen for
// example if this Buffer has been modified by another view.
cursor_.fixIfBroken();
+
+ if (fitCursor())
+ // Update the metrics if the cursor new position was off screen.
+ updateMetrics(false);
}
- updateMetrics(false);
+
if (graphics::Previews::status() != LyXRC::PREVIEW_OFF)
graphics::Previews::get().generateBufferPreviews(*buffer_);
}
+
void BufferView::resize()
{
if (!buffer_)
// goto bookmark to update bookmark pit.
for (size_t i = 0; i < LyX::ref().session().bookmarks().size(); ++i)
gotoBookmark(i+1, false, false);
- if (theBufferList().close(lyx_view_->buffer(), true) && !quitting) {
- if (theBufferList().empty()) {
- // need this otherwise SEGV may occur while
- // trying to set variables that don't exist
- // since there's no current buffer
- lyx_view_->getDialogs().hideBufferDependent();
- } else {
- lyx_view_->setBuffer(theBufferList().first());
- }
- }
+
+ theBufferList().close(lyx_view_->buffer(), true);
}