aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-07-26 21:27:41 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2018-08-13 13:35:35 +0200
commitfa4c2601000df2d792b0de865da3ac8c43ab723f (patch)
tree9048f5e4bf1a7aa06c24eade3f7b8f27fd9cacca /src/nvim/syntax.c
parentfab555e59c627b07e8a2d229d95737be7d6ce666 (diff)
downloadrneovim-fa4c2601000df2d792b0de865da3ac8c43ab723f.tar.gz
rneovim-fa4c2601000df2d792b0de865da3ac8c43ab723f.tar.bz2
rneovim-fa4c2601000df2d792b0de865da3ac8c43ab723f.zip
cursor_shape: use attribute ids instead of syntax ids
As attribute ids is the convention in the UI protocol Also remove non-threadsafe calls in tui.c to syntax module.
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index d7c23742ba..3cb998b805 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -16,6 +16,7 @@
#include "nvim/ascii.h"
#include "nvim/syntax.h"
#include "nvim/charset.h"
+#include "nvim/cursor_shape.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_docmd.h"
@@ -7228,7 +7229,6 @@ static void set_hl_attr(int idx)
HlAttrs at_en = HLATTRS_INIT;
struct hl_group *sgp = HL_TABLE() + idx;
-
at_en.cterm_ae_attr = sgp->sg_cterm;
at_en.cterm_fg_color = sgp->sg_cterm_fg;
at_en.cterm_bg_color = sgp->sg_cterm_bg;
@@ -7241,6 +7241,11 @@ static void set_hl_attr(int idx)
at_en.rgb_sp_color = sgp->sg_rgb_sp_name ? sgp->sg_rgb_sp : -1;
sgp->sg_attr = hl_get_syn_attr(idx+1, at_en);
+
+ // a cursor style uses this syn_id, make sure its atribute is updated.
+ if (cursor_mode_uses_syn_id(idx+1)) {
+ ui_mode_info_set();
+ }
}
/// Lookup a highlight group name and return its ID.