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;
https://github.com/vim/vim/pull/19555
(2 files)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 1 commit.
—
View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
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.![]()
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
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.![]()
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
@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.![]()
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
@64-bitman pushed 1 commit.
You are receiving this because you are subscribed to this thread.![]()
Done
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()