void
showruler(int always)
{
- bool override_success;
if (!always && !redrawing())
return;
if (pum_visible())
curwin->w_redr_status = TRUE;
return;
}
- override_success = push_highlight_overrides(curwin->w_hl, curwin->w_hl_len);
#if defined(FEAT_STL_OPT)
if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
redraw_custom_statusline(curwin);
else
#endif
win_redr_ruler(curwin, always, FALSE);
- if (override_success)
- pop_highlight_overrides();
if (need_maketitle
#ifdef FEAT_STL_OPT
int this_ru_col;
int n1; // scratch value
int n2; // scratch value
+ bool override_success =
+ push_highlight_overrides(wp->w_hl, wp->w_hl_len);
cursor_off();
if (wp->w_status_height)
#ifdef FEAT_DIFF
wp->w_ru_topfill = wp->w_topfill;
#endif
+
+ if (override_success)
+ pop_highlight_overrides();
}
}
int col = 0;
int next_col;
int off = (int)(current_ScreenLine - ScreenLines);
+ bool override_success =
+ push_highlight_overrides(wp->w_hl, wp->w_hl_len);
int fill_attr = syn_name2attr((char_u *)"ToolbarLine");
int button_attr = syn_name2attr((char_u *)"ToolbarButton");
screen_line(wp, wp->w_winrow, wp->w_wincol, wp->w_width,
wp->w_width, -1, 0);
+
+ if (override_success)
+ pop_highlight_overrides();
}
#endif
#if defined(FEAT_SYN_HL) || defined(FEAT_SEARCH_EXTRA)
int save_got_int;
#endif
+ bool override_success;
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
// This needs to be done only for the first window when update_screen() is
return;
}
+ override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);
+
+
#ifdef FEAT_TERMINAL
// If this window contains a terminal, redraw works completely differently.
if (term_do_update_window(wp))
redraw_win_toolbar(wp);
# endif
wp->w_redr_type = 0;
+ if (override_success)
+ pop_highlight_overrides();
return;
}
#endif
if (!got_int)
got_int = save_got_int;
#endif
+
+ if (override_success)
+ pop_highlight_overrides();
}
#if defined(FEAT_NETBEANS_INTG) || defined(FEAT_GUI)
typedef struct hl_overrides_S hl_overrides_T;
struct hl_overrides_S
{
- hl_override_T *arr;
+ hl_override_T *arr; // May be NULL if "arr" was freed
int len;
- hl_overrides_T *next; // Used to handle recursive calls
+ hl_overrides_T *next; // Used to handle recursive calls
- int attr[HLF_COUNT]; // highlight_attr[] before being updated.
+ int attr[HLF_COUNT]; // highlight_attr[] before being updated.
};
static hl_overrides_T *overrides = NULL;
}
}
+/*
+ * 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)
+ {
+ if (set->arr == arr)
+ {
+ set->arr = NULL;
+ break;
+ }
+ }
+}
+
/*
* Update highlight_attr[] array. If "update_ids" is true, then update
* highlight_ids[] array instead.
void f_hlget(typval_T *argvars, typval_T *rettv);
void f_hlset(typval_T *argvars, typval_T *rettv);
void update_highlight_overrides(hl_override_T *old, hl_override_T *hl_new, int newlen);
+void remove_highlight_overrides(hl_override_T *arr);
bool push_highlight_overrides(hl_override_T *arr, int len);
void pop_highlight_overrides(void);
char *update_winhighlight(win_T *wp, char_u *opt);
int
get_win_attr(win_T *wp)
{
- int win_attr = wp->w_hlfwin_id;
+ int win_attr = wp->w_hlfwin_id;
+ bool override_success =
+ push_highlight_overrides(wp->w_hl, wp->w_hl_len);
if (win_attr != 0)
{
win_attr = HL_ATTR(HLF_PNI); // Pmenu
}
#endif
+
+ if (override_success)
+ pop_highlight_overrides();
return win_attr;
}
int n = 0;
int attr = HL_ATTR(hl);
int win_attr = get_win_attr(wp);
+ bool override_success =
+ push_highlight_overrides(wp->w_hl, wp->w_hl_len);
attr = hl_combine_attr(win_attr, attr);
}
set_empty_rows(wp, row);
+
+ if (override_success)
+ pop_highlight_overrides();
}
#if defined(FEAT_FOLDING)
int clear_next = FALSE;
int char_cells; // 1: normal char
// 2: occupies two display cells
+ bool override_success =
+ push_highlight_overrides(wp->w_hl, wp->w_hl_len);
// Check for illegal row and col, just in case.
if (row >= Rows)
else
LineWraps[row] = FALSE;
}
+
+ if (override_success)
+ pop_highlight_overrides();
}
#if defined(FEAT_RIGHTLEFT)
stl_hlrec_T *tabtab;
win_T *ewp;
int p_crb_save;
+ bool override_success = false;
// There is a tiny chance that this gets called recursively: When
// redrawing a status line triggers redrawing the ruler or tabline.
}
else
{
+ override_success = push_highlight_overrides(wp->w_hl, wp->w_hl_len);
+
row = statusline_row(wp);
fillchar = fillchar_status(&attr, wp);
int in_status_line = wp->w_status_height != 0;
}
theend:
+ if (override_success)
+ pop_highlight_overrides();
entered = FALSE;
}
int
fillchar_status(int *attr, win_T *wp)
{
- int fill;
+ int fill;
+ bool override_success =
+ push_highlight_overrides(wp->w_hl, wp->w_hl_len);
#ifdef FEAT_TERMINAL
if (bt_terminal(wp->w_buffer))
*attr = HL_ATTR(HLF_SNC);
fill = wp->w_fill_chars.stlnc;
}
+
+ if (override_success)
+ pop_highlight_overrides();
return fill;
}
int
fillchar_vsep(int *attr, win_T *wp)
{
+ bool override_success =
+ push_highlight_overrides(wp->w_hl, wp->w_hl_len);
*attr = HL_ATTR(HLF_C);
+ if (override_success)
+ pop_highlight_overrides();
+
if (*attr == 0 && wp->w_fill_chars.vert == ' ')
return '|';
else
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 111,
/**/
110,
/**/
ruby_window_free(wp);
#endif
+ remove_highlight_overrides(wp->w_hl);
vim_free(wp->w_hl);
clear_winopt(&wp->w_onebuf_opt);