feat(ui): add scroll_delta to win_viewport event #19270

scroll_delta contains how much the top line of a window moved since the
last time win_viewport was emitted. It is expected to be used to
implement smooth scrolling. For this purpose it only counts "virtual" or
"displayed" so folds should count as one line. Because of this it
adds extra information that cannot be computed from the topline
parameter.

Fixes #19227
This commit is contained in:
Matthias Deiml
2023-03-12 23:58:46 +01:00
committed by GitHub
parent e5f4394eb7
commit fd2ece278b
10 changed files with 192 additions and 114 deletions

View File

@@ -1222,6 +1222,7 @@ struct window_S {
colnr_T w_valid_leftcol; // last known w_leftcol
bool w_viewport_invalid;
linenr_T w_viewport_last_topline; // topline when the viewport was last updated
// w_cline_height is the number of physical lines taken by the buffer line
// that the cursor is on. We use this to avoid extra calls to plines_win().