patch 9.0.1279: display shows lines scrolled down erroneously
Problem: Display shows lines scrolled down erroneously. (Yishai Lerner)
Solution: Do not change "wl_lnum" at index zero. (closes #11938)
diff --git a/src/change.c b/src/change.c
index 1e7bdd6..e5798c5 100644
--- a/src/change.c
+++ b/src/change.c
@@ -611,7 +611,9 @@
{
if (wp->w_lines[i].wl_lnum >= lnum)
{
- if (wp->w_lines[i].wl_lnum < lnume)
+ // Do not change wl_lnum at index zero, it is used to
+ // compare with w_topline. Invalidate it instead.
+ if (wp->w_lines[i].wl_lnum < lnume || i == 0)
{
// line included in change
wp->w_lines[i].wl_valid = FALSE;