]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.cpp
simplification
[lyx.git] / src / BufferView.cpp
index 1c911517aba6c9df19944cb8f36412e276bfd6b1..d1147817429d60bbde77bdb71302af8b0138500b 100644 (file)
@@ -647,8 +647,13 @@ bool BufferView::moveToPosition(pit_type bottom_pit, pos_type bottom_pos,
                setCursor(doc_it);
                // set the current font.
                d->cursor_.setCurrentFont();
-               // center the screen on this new position.
-               center();
+               // To center the screen on this new position we need the
+               // paragraph position which is computed at draw() time.
+               // So we need a redraw!
+               buffer_.changed();
+               if (fitCursor())
+                       // We need another redraw because of the screen recentering.
+                       buffer_.changed();
        }
 
        return success;
@@ -2014,10 +2019,10 @@ docstring BufferView::contentsOfPlaintextFile(string const & f,
                if (result.first == FileDialog::Later)
                        return docstring();
 
-               fname = makeAbsPath(to_utf8(result.second));
-
-               if (fname.empty())
+               if (result.second.empty())
                        return docstring();
+
+               fname = makeAbsPath(to_utf8(result.second));
        }
 
        if (!fname.isReadable()) {