aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/buffer.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2017-10-19 11:46:07 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2017-10-19 11:59:32 +0200
commitdfe806ea8b90ace9ef2ee63aafbf10ebea2df7ef (patch)
tree5e95126753bf9cea01966a1e362f032964fc1b52 /src/nvim/api/buffer.c
parent91586d1ad4acd799e2815d774d5af2935bad8a0e (diff)
downloadrneovim-dfe806ea8b90ace9ef2ee63aafbf10ebea2df7ef.tar.gz
rneovim-dfe806ea8b90ace9ef2ee63aafbf10ebea2df7ef.tar.bz2
rneovim-dfe806ea8b90ace9ef2ee63aafbf10ebea2df7ef.zip
bufhl: support creating new groups
Diffstat (limited to 'src/nvim/api/buffer.c')
-rw-r--r--src/nvim/api/buffer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 82de8fd4a2..c381e92dc7 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -793,7 +793,11 @@ Integer nvim_buf_add_highlight(Buffer buffer,
col_end = MAXCOL;
}
- int hlg_id = syn_name2id((char_u *)(hl_group.data ? hl_group.data : ""));
+ int hlg_id = 0;
+ if (hl_group.size > 0) {
+ hlg_id = syn_check_group((char_u *)hl_group.data, (int)hl_group.size);
+ }
+
src_id = bufhl_add_hl(buf, (int)src_id, hlg_id, (linenr_T)line+1,
(colnr_T)col_start+1, (colnr_T)col_end);
return src_id;