Do not redraw cursor twice with Page Up/Down

Just recompute metrics instead of triggering a full redraw. The old
behavior was that, when the document was less that one page long, the
cursor would blink to the top of the document before going to its
correct position.
This commit is contained in:
Jean-Marc Lasgouttes 2021-02-12 15:22:23 +01:00
parent a78eb4471f
commit 1cbbe5c3aa

View File

@ -1855,7 +1855,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
cur.setCursor(doc_iterator_begin(cur.buffer()));
cur.selHandle(false);
// Force an immediate computation of metrics because we need it below
processUpdateFlags(Update::Force);
updateMetrics();
d->text_metrics_[&buffer_.text()].editXY(cur, p.x_, p.y_,
true, act == LFUN_SCREEN_UP);