]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
Move \PassOptionsToPackage before the first package loaded
[lyx.git] / src / BufferView.cpp
index e31efcf673d433a52ab8efef42dca41d8335cb33..621b58ef26fc74fdeeb6b0242bc39ab92c61e9f7 100644 (file)
@@ -528,12 +528,15 @@ void BufferView::processUpdateFlags(Update::flags flags)
                        // First try to make the selection start visible
                        // (which is just the cursor when there is no selection)
                        scrollToCursor(d->cursor_.selectionBegin(), false);
+                       // Metrics have to be recomputed (maybe again)
+                       updateMetrics();
                        // Is the cursor visible? (only useful if cursor is at end of selection)
-                       if (needsFitCursor())
+                       if (needsFitCursor()) {
                                // then try to make cursor visible instead
                                scrollToCursor(d->cursor_, false);
-                       // Metrics have to be recomputed (maybe again)
-                       updateMetrics(flags);
+                               // Metrics have to be recomputed (maybe again)
+                               updateMetrics(flags);
+                       }
                }
                flags = flags & ~Update::FitCursor;
        }
@@ -935,7 +938,10 @@ bool BufferView::scrollToCursor(DocIterator const & dit, bool const recenter)
        if (height_ == 0)
                return false;
 
-       LYXERR(Debug::SCROLLING, "recentering!");
+       if (recenter)
+         LYXERR(Debug::SCROLLING, "recentering and scrolling to cursor");
+       else
+         LYXERR(Debug::SCROLLING, "scrolling to cursor");
 
        CursorSlice const & bot = dit.bottom();
        TextMetrics & tm = d->text_metrics_[bot.text()];