aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2016-08-17 11:09:42 +0200
committerGitHub <noreply@github.com>2016-08-17 11:09:42 +0200
commit6b48d25cbf053720a128bfc124d2ee211addcf5c (patch)
tree0a61a99bc1def8e4cce1eed17be833427bf7bc0a /src
parentc9b29d3884c380d8de51eb163bbc03cf79a5f886 (diff)
parent57ac9b093465077f691359909c795c0259dec7ba (diff)
downloadrneovim-6b48d25cbf053720a128bfc124d2ee211addcf5c.tar.gz
rneovim-6b48d25cbf053720a128bfc124d2ee211addcf5c.tar.bz2
rneovim-6b48d25cbf053720a128bfc124d2ee211addcf5c.zip
Merge pull request #5228 from bfredl/nullbufhl
api: handle null string in buffer_add_highlight
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c
index 55b535c78c..c3bc1f52af 100644
--- a/src/nvim/api/buffer.c
+++ b/src/nvim/api/buffer.c
@@ -691,7 +691,7 @@ Integer buffer_add_highlight(Buffer buffer,
col_end = MAXCOL;
}
- int hlg_id = syn_name2id((char_u*)hl_group.data);
+ int hlg_id = syn_name2id((char_u *)(hl_group.data ? hl_group.data : ""));
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;