patch 8.2.5035: when splitting a window the changelist position moves
Problem: When splitting a window the changelist position moves.
Solution: Set the changelist index a bit later. (closes #10493)
diff --git a/src/window.c b/src/window.c
index fa59ade..f2913d4 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1354,9 +1354,6 @@
p_wh = size;
}
- // Keep same changelist position in new window.
- wp->w_changelistidx = oldwin->w_changelistidx;
-
/*
* make the new window the current window
*/
@@ -1431,6 +1428,10 @@
}
newp->w_tagstackidx = oldp->w_tagstackidx;
newp->w_tagstacklen = oldp->w_tagstacklen;
+
+ // Keep same changelist position in new window.
+ newp->w_changelistidx = oldp->w_changelistidx;
+
#ifdef FEAT_FOLDING
copyFoldingState(oldp, newp);
#endif