aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-07-17 12:23:15 +0100
committerLewis Russell <me@lewisr.dev>2024-07-31 11:33:32 +0100
commit573a71469d37cc35f72bfc929f4ce1156833df9f (patch)
treea00230976aa453aabb2c9de073e08ccde343e400 /src/nvim/option.c
parentc9b129a02ab46fc80c81f3f9cabed4040a7462c0 (diff)
downloadrneovim-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/option.c')
-rw-r--r--src/nvim/option.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 8fb97ed979..e7d8bb91ac 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -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;
}