mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
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
This commit is contained in:

committed by
Lewis Russell

parent
c9b129a02a
commit
573a71469d
@@ -2143,7 +2143,11 @@ int diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dp->is_linematched && diff_linematch(dp)) {
|
||||
// Don't run linematch when lnum is offscreen.
|
||||
// Useful for scrollbind calculations which need to count all the filler lines
|
||||
// above the screen.
|
||||
if (lnum >= wp->w_topline && lnum < wp->w_botline
|
||||
&& !dp->is_linematched && diff_linematch(dp)) {
|
||||
run_linematch_algorithm(dp);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user