diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 12afa84116..28577f231f 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -1079,6 +1079,11 @@ bool BufferView::scrollToCursor(DocIterator const & dit, ScrollType how) d->anchor_ypos_ += height_/2 - row_dim.height() / 2; else if (!lyxrc.scroll_below_document && d->anchor_pit_ == max_pit) d->anchor_ypos_ = height_ - offset - row_dim.descent(); + else if (offset > height_) + d->anchor_ypos_ = height_ - offset - defaultRowHeight(); + else + d->anchor_ypos_ = defaultRowHeight() * 2; + return d->anchor_ypos_ != old_ypos || d->anchor_pit_ != old_pit; }