aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/drawscreen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/drawscreen.c')
-rw-r--r--src/nvim/drawscreen.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c
index 6cc623cb72..659edf2085 100644
--- a/src/nvim/drawscreen.c
+++ b/src/nvim/drawscreen.c
@@ -76,7 +76,6 @@
#include "nvim/eval.h"
#include "nvim/ex_getln.h"
#include "nvim/fold.h"
-#include "nvim/func_attr.h"
#include "nvim/getchar.h"
#include "nvim/gettext.h"
#include "nvim/globals.h"
@@ -1475,6 +1474,19 @@ static void win_update(win_T *wp, DecorProviders *providers)
return;
}
+ // Link colorcolumn syn_attrs to syn_names. Needs to be done at a redraw
+ // as the syn names are volitile and can change.
+ if (wp->w_p_cc_cols) {
+ for (int i = 0; wp->w_p_cc_cols[i].col >= 0; ++ i) {
+ const char* syn_name = wp->w_p_cc_cols[i].syn_name;
+ if (syn_name == NULL) {
+ wp->w_p_cc_cols[i].syn_attr = win_hl_attr(wp, HLF_MC);
+ } else {
+ wp->w_p_cc_cols[i].syn_attr = syn_name2attr(syn_name);
+ }
+ }
+ }
+
buf_T *buf = wp->w_buffer;
// reset got_int, otherwise regexp won't work