aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/highlight_group.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/highlight_group.c')
-rw-r--r--src/nvim/highlight_group.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/nvim/highlight_group.c b/src/nvim/highlight_group.c
index 080dc79e0e..5cbff6e3dd 100644
--- a/src/nvim/highlight_group.c
+++ b/src/nvim/highlight_group.c
@@ -18,13 +18,13 @@
#include "nvim/ascii.h"
#include "nvim/autocmd.h"
#include "nvim/charset.h"
+#include "nvim/cmdexpand_defs.h"
#include "nvim/cursor_shape.h"
#include "nvim/decoration_provider.h"
#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/eval/typval_defs.h"
#include "nvim/eval/vars.h"
-#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/garray.h"
#include "nvim/gettext.h"
@@ -866,9 +866,17 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id)
if (strcmp(g->sg_name_u, "NORMAL") == 0) {
cterm_normal_fg_color = g->sg_cterm_fg;
cterm_normal_bg_color = g->sg_cterm_bg;
+ bool did_changed = false;
+ if (normal_bg != g->sg_rgb_bg || normal_fg != g->sg_rgb_fg || normal_sp != g->sg_rgb_sp) {
+ did_changed = true;
+ }
normal_fg = g->sg_rgb_fg;
normal_bg = g->sg_rgb_bg;
normal_sp = g->sg_rgb_sp;
+
+ if (did_changed) {
+ highlight_attr_set_all();
+ }
ui_default_colors_set();
} else {
// a cursor style uses this syn_id, make sure its attribute is updated.
@@ -2283,10 +2291,10 @@ static void highlight_list_two(int cnt, int attr)
}
/// Function given to ExpandGeneric() to obtain the list of group names.
-const char *get_highlight_name(expand_T *const xp, int idx)
+char *get_highlight_name(expand_T *const xp, int idx)
FUNC_ATTR_WARN_UNUSED_RESULT
{
- return get_highlight_name_ext(xp, idx, true);
+ return (char *)get_highlight_name_ext(xp, idx, true);
}
/// Obtain a highlight group name.