[vim/vim] Push winhighlight override in more places (PR #19555)

17 views
Skip to first unread message

Foxe Chen

unread,
Mar 2, 2026, 9:24:23 PM (4 days ago) Mar 2
to vim/vim, Subscribed

Might be a bit excessive, but better to be safe. Shouldn't have any impact on performance due to this if statement in push_highlight_override():

    if (arr == NULL || (overrides != NULL && overrides->arr == arr))
	return false;

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/19555

Commit Summary

  • b069bd9 push winhighlight in more places

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555@github.com>

Foxe Chen

unread,
Mar 2, 2026, 9:35:45 PM (4 days ago) Mar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 058f659 push winhighlight in more places


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/before/b069bd9ff016700532206a4348b15f173478a6be/after/058f6592fc862392efeab02b2c4ce55c3013b94c@github.com>

Foxe Chen

unread,
Mar 2, 2026, 9:40:56 PM (4 days ago) Mar 2
to vim/vim, Push

@64-bitman pushed 1 commit.

  • dcee3c7 push winhighlight in more places

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/before/058f6592fc862392efeab02b2c4ce55c3013b94c/after/dcee3c7c8057b6f754515cdb38bd47850999012a@github.com>

Foxe Chen

unread,
Mar 3, 2026, 8:35:25 AM (4 days ago) Mar 3
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19555)

I will close this PR and open another PR that refactors the winhighlight code


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/c3991125729@github.com>

Foxe Chen

unread,
Mar 4, 2026, 1:53:01 PM (2 days ago) Mar 4
to vim/vim, Subscribed

Reopened #19555.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/issue_event/23270263853@github.com>

Foxe Chen

unread,
Mar 4, 2026, 1:53:21 PM (2 days ago) Mar 4
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19555)

Reopening this now, I think this is ready.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/c3999497924@github.com>

Foxe Chen

unread,
Mar 4, 2026, 2:40:19 PM (2 days ago) Mar 4
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 6de3b62 push winhighlight in more places

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/before/dcee3c7c8057b6f754515cdb38bd47850999012a/after/6de3b62c65736288807069f4db1e9fad2292948a@github.com>

Foxe Chen

unread,
Mar 4, 2026, 2:42:20 PM (2 days ago) Mar 4
to vim/vim, Push

@64-bitman pushed 1 commit.

  • ef9c263 push winhighlight in more places

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/before/6de3b62c65736288807069f4db1e9fad2292948a/after/ef9c26359ea1123c61b94a686c41a7a7c11f17d4@github.com>

Christian Brabandt

unread,
Mar 4, 2026, 4:21:34 PM (2 days ago) Mar 4
to vim/vim, Subscribed

@chrisbra commented on this pull request.


In src/drawscreen.c:

> @@ -744,6 +740,9 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum)
 	int	this_ru_col;
 	int	n1;			    // scratch value
 	int	n2;			    // scratch value
+	bool	override_success;
+
+	override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);
⬇️ Suggested change
-	override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);
+	bool override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);

In src/drawscreen.c:

> @@ -1029,8 +1031,14 @@ redraw_win_toolbar(win_T *wp)
     int		col = 0;
     int		next_col;
     int		off = (int)(current_ScreenLine - ScreenLines);
-    int		fill_attr = syn_name2attr((char_u *)"ToolbarLine");
-    int		button_attr = syn_name2attr((char_u *)"ToolbarButton");
+    bool	override_success;
⬇️ Suggested change
-    bool	override_success;
+    bool	override_success  = push_highlight_overrides(wp->w_hl, wp->w_hl_len);

In src/drawscreen.c:

> @@ -1029,8 +1031,14 @@ redraw_win_toolbar(win_T *wp)
     int		col = 0;
     int		next_col;
     int		off = (int)(current_ScreenLine - ScreenLines);
-    int		fill_attr = syn_name2attr((char_u *)"ToolbarLine");
-    int		button_attr = syn_name2attr((char_u *)"ToolbarButton");
+    bool	override_success;
+    int		fill_attr;
⬇️ Suggested change
-    int		fill_attr;
+    int		fill_attr = syn_name2attr((char_u *)"ToolbarLine");
+    int     button_attr = syn_name2attr((char_u *)"ToolbarButton");

In src/highlight.c:

> @@ -5478,6 +5478,23 @@ update_highlight_overrides(hl_override_T *old, hl_override_T *hl_new, int newlen
     }
 }
 
+/*
+ * If "arr" is in the highlight overrides list, then mark it as invalid.
+ */
+    void
+remove_highlight_overrides(hl_override_T *arr)
+{
+    if (arr == NULL || overrides == NULL)
+	return;
+
+    for (hl_overrides_T *set = overrides; set != NULL; set = set->next)

I found the missing braces a bit misleading, so please add braces for the loop body:

⬇️ Suggested change
-    for (hl_overrides_T *set = overrides; set != NULL; set = set->next)
+    for (hl_overrides_T *set = overrides; set != NULL; set = set->next)
+    {
+        if (set->arr == arr)
+        ...
+    }

In src/screen.c:

> @@ -117,7 +117,10 @@ conceal_check_cursor_line(int was_concealed)
     int
 get_win_attr(win_T *wp)
 {
-    int win_attr = wp->w_hlfwin_id;
+    int	    win_attr = wp->w_hlfwin_id;
+    bool    override_success;
⬇️ Suggested change
-    bool    override_success;
+    bool    override_success  = push_highlight_overrides(wp->w_hl, wp->w_hl_len);;

In src/screen.c:

> @@ -190,6 +196,9 @@ win_draw_end(
     int		n = 0;
     int		attr = HL_ATTR(hl);
     int		win_attr = get_win_attr(wp);
+    bool	override_success;
+
+    override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);

same here


In src/screen.c:

> @@ -489,6 +501,9 @@ screen_line(
     int		    clear_next = FALSE;
     int		    char_cells;		// 1: normal char
 					// 2: occupies two display cells
+    bool	    override_success;
+
+    override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);

and here


In src/screen.c:

> @@ -4773,7 +4796,10 @@ get_trans_bufname(buf_T *buf)
     int
 fillchar_status(int *attr, win_T *wp)
 {
-    int fill;
+    int	    fill;
+    bool    override_success;

and here


In src/screen.c:

> @@ -4811,7 +4840,13 @@ fillchar_status(int *attr, win_T *wp)
     int
 fillchar_vsep(int *attr, win_T *wp)
 {
+    bool override_success;
+
+    override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);

and here


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/review/3892064363@github.com>

Foxe Chen

unread,
Mar 5, 2026, 12:23:13 AM (yesterday) Mar 5
to vim/vim, Push

@64-bitman pushed 1 commit.

  • 4e531c8 push winhighlight in more places

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/before/ef9c26359ea1123c61b94a686c41a7a7c11f17d4/after/4e531c8bd6b8d87fbc7194826ec20cb4b42b9c61@github.com>

Foxe Chen

unread,
Mar 5, 2026, 12:24:32 AM (yesterday) Mar 5
to vim/vim, Push

@64-bitman pushed 1 commit.

  • ea29ee1 push winhighlight in more places

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/before/4e531c8bd6b8d87fbc7194826ec20cb4b42b9c61/after/ea29ee16bcbf9f3217d200d79b0bc1b978c19670@github.com>

Foxe Chen

unread,
Mar 5, 2026, 12:24:59 AM (yesterday) Mar 5
to vim/vim, Subscribed
64-bitman left a comment (vim/vim#19555)

Done


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/c4002301977@github.com>

Christian Brabandt

unread,
Mar 5, 2026, 3:25:40 PM (yesterday) Mar 5
to vim/vim, Subscribed

Closed #19555 via 0fe3ca6.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/19555/issue_event/23310665162@github.com>

Reply all
Reply to author
Forward
0 new messages