patch 9.2.0119: incorrect highlight initialization in win_init()

Commit: 
https://github.com/vim/vim/commit/6495ca4c165d9a1ba32947282c8473cb6b664be8
Author: Foxe Chen <[email protected]>
Date:   Sat Mar 7 18:35:39 2026 +0000

    patch 9.2.0119: incorrect highlight initialization in win_init()
    
    Problem:  When initializing a window in win_init(), w_hl is reset to
              NULL without ensuring existing highlight overrides are
              cleared (after v9.2.0113)
    Solution: Clear highlight overrides and reset w_hl in win_init(). Remove
              the redundant VIM_CLEAR() from win_init_empty() (Foxe Chen).
    
    closes: #19609
    
    Signed-off-by: Foxe Chen <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/version.c b/src/version.c
index 40fbefb3c..1135e03cc 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    119,
 /**/
     118,
 /**/
diff --git a/src/window.c b/src/window.c
index 525fc4b2e..2925fbe23 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1565,7 +1565,11 @@ win_init(win_T *newp, win_T *oldp, int flags UNUSED)
     newp->w_wrow = oldp->w_wrow;
     newp->w_fraction = oldp->w_fraction;
     newp->w_prev_fraction_row = oldp->w_prev_fraction_row;
-    newp->w_hl = NULL;
+
+    // Not sure if this is needed, but be safe
+    remove_highlight_overrides(newp->w_hl);
+    VIM_CLEAR(newp->w_hl);
+
     copy_jumplist(oldp, newp);
 #ifdef FEAT_QUICKFIX
     if (flags & WSP_NEWLOC)
@@ -2522,7 +2526,6 @@ win_init_empty(win_T *wp)
     wp->w_prev_pcmark.lnum = 0;
     wp->w_prev_pcmark.col = 0;
     wp->w_topline = 1;
-    VIM_CLEAR(wp->w_hl);
 #ifdef FEAT_DIFF
     wp->w_topfill = 0;
 #endif

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1vywsd-00BcxK-B3%40256bit.org.

Raspunde prin e-mail lui