Skip to content

Commit 6495ca4

Browse files
64-bitmanchrisbra
authored andcommitted
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 <chen.foxe@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent d180f67 commit 6495ca4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
119,
737739
/**/
738740
118,
739741
/**/

src/window.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,11 @@ win_init(win_T *newp, win_T *oldp, int flags UNUSED)
15651565
newp->w_wrow = oldp->w_wrow;
15661566
newp->w_fraction = oldp->w_fraction;
15671567
newp->w_prev_fraction_row = oldp->w_prev_fraction_row;
1568-
newp->w_hl = NULL;
1568+
1569+
// Not sure if this is needed, but be safe
1570+
remove_highlight_overrides(newp->w_hl);
1571+
VIM_CLEAR(newp->w_hl);
1572+
15691573
copy_jumplist(oldp, newp);
15701574
#ifdef FEAT_QUICKFIX
15711575
if (flags & WSP_NEWLOC)
@@ -2522,7 +2526,6 @@ win_init_empty(win_T *wp)
25222526
wp->w_prev_pcmark.lnum = 0;
25232527
wp->w_prev_pcmark.col = 0;
25242528
wp->w_topline = 1;
2525-
VIM_CLEAR(wp->w_hl);
25262529
#ifdef FEAT_DIFF
25272530
wp->w_topfill = 0;
25282531
#endif

0 commit comments

Comments
 (0)