diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-07-17 12:23:15 +0100 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-07-31 11:33:32 +0100 |
commit | 573a71469d37cc35f72bfc929f4ce1156833df9f (patch) | |
tree | a00230976aa453aabb2c9de073e08ccde343e400 /src/nvim/drawline.c | |
parent | c9b129a02ab46fc80c81f3f9cabed4040a7462c0 (diff) | |
download | rneovim-573a71469d37cc35f72bfc929f4ce1156833df9f.tar.gz rneovim-573a71469d37cc35f72bfc929f4ce1156833df9f.tar.bz2 rneovim-573a71469d37cc35f72bfc929f4ce1156833df9f.zip |
fix(scrollbind): properly take filler/virtual lines into account
Problem:
`'scrollbind'` does not work properly if the window being scrolled
automatically contains any filler/virtual lines (except for diff filler
lines).
This is because when the scrollbind check is done, the logic only
considers changes to topline which are represented as line numbers.
Solution:
Write the logic for determine the scroll amount to take into account
filler/virtual lines.
Fixes #29751
Diffstat (limited to 'src/nvim/drawline.c')
-rw-r--r-- | src/nvim/drawline.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 47d84e6539..8a948716e5 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1156,7 +1156,7 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, int col_rows, s area_highlighting = true; } VirtLines virt_lines = KV_INITIAL_VALUE; - wlv.n_virt_lines = decor_virt_lines(wp, lnum, &virt_lines); + wlv.n_virt_lines = decor_virt_lines(wp, lnum - 1, lnum, &virt_lines, true); wlv.filler_lines += wlv.n_virt_lines; if (lnum == wp->w_topline) { wlv.filler_lines = wp->w_topfill; |