mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 14:38: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
@@ -88,6 +88,7 @@
|
||||
#include "nvim/os/os.h"
|
||||
#include "nvim/os/os_defs.h"
|
||||
#include "nvim/path.h"
|
||||
#include "nvim/plines.h"
|
||||
#include "nvim/popupmenu.h"
|
||||
#include "nvim/pos_defs.h"
|
||||
#include "nvim/regexp.h"
|
||||
@@ -2474,7 +2475,7 @@ static const char *did_set_scrollbind(optset_T *args)
|
||||
return NULL;
|
||||
}
|
||||
do_check_scrollbind(false);
|
||||
win->w_scbind_pos = win->w_topline;
|
||||
win->w_scbind_pos = get_vtopline(win);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user