aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorMatthias Deiml <matthias@deiml.net>2023-03-12 23:58:46 +0100
committerGitHub <noreply@github.com>2023-03-12 15:58:46 -0700
commitfd2ece278b0941ec6673489e88868120e86b834a (patch)
treeaf318b0e355797ee3086037d52e2203492d13ddc /src/nvim/buffer_defs.h
parente5f4394eb7a27a9e5eaab088e6acf5553c64cf59 (diff)
downloadrneovim-fd2ece278b0941ec6673489e88868120e86b834a.tar.gz
rneovim-fd2ece278b0941ec6673489e88868120e86b834a.tar.bz2
rneovim-fd2ece278b0941ec6673489e88868120e86b834a.zip
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
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 6122136a75..4bdf5aac64 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -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().