summaryrefslogtreecommitdiffstats
path: root/src/change.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/change.c')
-rw-r--r--src/change.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/change.c b/src/change.c
index 1e7bdd6bdb..e5798c54a4 100644
--- a/src/change.c
+++ b/src/change.c
@@ -611,7 +611,9 @@ changed_common(
{
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;