summaryrefslogtreecommitdiffstats
path: root/src/move.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-10-04 21:45:33 +0200
committerChristian Brabandt <cb@256bit.org>2023-10-04 21:45:33 +0200
commit8e5f26ec6a1446aabffa7a0a7819a7462372a5b8 (patch)
tree263693efac261c5910049981776d0ed7d3c71878 /src/move.c
parent4dbb2669e9ed9ec6864705dcb569715e417e1303 (diff)
patch 9.0.1983: scrolling inactive window not possible with cursorbindv9.0.1983
Problem: Scrolling non-current window using mouse is inconsistent depending on 'scrollbind'/'scrolloff' and different from GUI vertical scrollbar when 'cursorbind' is set. Solution: Don't move cursor in non-current windows for 'cursorbind' if cursor in the current window didn't move. closes: #13219 closes: #13210 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Diffstat (limited to 'src/move.c')
-rw-r--r--src/move.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/move.c b/src/move.c
index e5309df486..46e4f358dc 100644
--- a/src/move.c
+++ b/src/move.c
@@ -3571,6 +3571,14 @@ halfpage(int flag, linenr_T Prenum)
void
do_check_cursorbind(void)
{
+ static win_T *prev_curwin = NULL;
+ static pos_T prev_cursor = {0, 0, 0};
+
+ if (curwin == prev_curwin && EQUAL_POS(curwin->w_cursor, prev_cursor))
+ return;
+ prev_curwin = curwin;
+ prev_cursor = curwin->w_cursor;
+
linenr_T line = curwin->w_cursor.lnum;
colnr_T col = curwin->w_cursor.col;
colnr_T coladd = curwin->w_cursor.coladd;