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;
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()) {