struct stl_hlrec *sp;
int save_must_redraw = must_redraw;
int save_redr_type = curwin->w_redr_type;
- int save_highlight_shcnaged = need_highlight_changed;
#ifdef FEAT_EVAL
/*
sp->userhl = 0;
}
- /* We do not want redrawing a stausline, ruler, title, etc. to trigger
- * another redraw, it may cause an endless loop. This happens when a
- * statusline changes a highlight group. */
- must_redraw = save_must_redraw;
- curwin->w_redr_type = save_redr_type;
- need_highlight_changed = save_highlight_shcnaged;
+ /* When inside update_screen we do not want redrawing a stausline, ruler,
+ * title, etc. to trigger another redraw, it may cause an endless loop. */
+ if (updating_screen)
+ {
+ must_redraw = save_must_redraw;
+ curwin->w_redr_type = save_redr_type;
+ }
return width;
}
int id;
int idx;
struct hl_group item_before;
+ int did_change = FALSE;
int dodefault = FALSE;
int doclear = FALSE;
int dolink = FALSE;
/* GUI not started yet, always accept the name. */
vim_free(HL_TABLE()[idx].sg_font_name);
HL_TABLE()[idx].sg_font_name = vim_strsave(arg);
+ did_change = TRUE;
}
else
{
gui_mch_free_fontset(temp_sg_fontset);
vim_free(HL_TABLE()[idx].sg_font_name);
HL_TABLE()[idx].sg_font_name = vim_strsave(arg);
+ did_change = TRUE;
}
else
HL_TABLE()[idx].sg_fontset = temp_sg_fontset;
gui_mch_free_font(temp_sg_font);
vim_free(HL_TABLE()[idx].sg_font_name);
HL_TABLE()[idx].sg_font_name = vim_strsave(arg);
+ did_change = TRUE;
}
else
HL_TABLE()[idx].sg_font = temp_sg_font;
*namep = vim_strsave(arg);
else
*namep = NULL;
+ did_change = TRUE;
}
# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
# ifdef FEAT_GUI_X11
*namep = vim_strsave(arg);
else
*namep = NULL;
+ did_change = TRUE;
}
# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
# ifdef FEAT_GUI_X11
*namep = vim_strsave(arg);
else
*namep = NULL;
+ did_change = TRUE;
}
# ifdef FEAT_GUI
}
/* Only call highlight_changed() once, after a sequence of highlight
* commands, and only if an attribute actually changed. */
- if (memcmp(&HL_TABLE()[idx], &item_before, sizeof(item_before)) != 0
+ if ((did_change
+ || memcmp(&HL_TABLE()[idx], &item_before, sizeof(item_before)) != 0)
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
&& !did_highlight_changed
#endif
)
{
- redraw_all_later(NOT_VALID);
+ /* Do not trigger a redraw when highlighting is changed while
+ * redrawing. This may happen when evaluating 'statusline' changes the
+ * StatusLine group. */
+ if (!updating_screen)
+ redraw_all_later(NOT_VALID);
need_highlight_changed = TRUE;
}
}