diff src/window.c @ 29026:5baf5e50049b v8.2.5035

patch 8.2.5035: when splitting a window the changelist position moves Commit: https://github.com/vim/vim/commit/e6f13b473cf2c270e4eab214e09be9825320c11b Author: zeertzjq <zeertzjq@outlook.com> Date: Sat May 28 10:49:44 2022 +0100 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 https://github.com/vim/vim/issues/10493)
author Bram Moolenaar <Bram@vim.org>
date Sat, 28 May 2022 12:00:03 +0200
parents 45c182c4f7e9
children e150d0e4701f
line wrap: on
line diff
--- a/src/window.c
+++ b/src/window.c
@@ -1354,9 +1354,6 @@ win_split_ins(
 	    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 @@ win_init(win_T *newp, win_T *oldp, int f
     }
     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