patch 9.1.0822: topline might be changed in diff mode unexpectedly
Problem: topline might be changed in diff mode unexpectedly
(Jaehwang Jung)
Solution: do not re-calculate topline, when using line() func
in diff mode.
fixes: #15812
closes: #15950
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/evalfunc.c b/src/evalfunc.c
index d902045..f6a3f9d 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -8359,9 +8359,15 @@
{
if (switch_win_noblock(&switchwin, wp, tp, TRUE) == OK)
{
+ // in diff mode, prevent that the window scrolls
+ // and keep the topline
+ if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff)
+ skip_update_topline = TRUE;
check_cursor();
fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE);
}
+ if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff)
+ skip_update_topline = FALSE;
restore_win_noblock(&switchwin, TRUE);
}
}