diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-03-31 20:21:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-31 20:21:47 +0800 |
commit | b25753381c6049132c5c8d02eb62df99f8a958fd (patch) | |
tree | 7acd3961648f9d7a9b76a4297f8384de5ba2ca51 /src/nvim/api/vim.c | |
parent | e1ff2c51cad755d0ddc04a23df23e317d77023ed (diff) | |
download | rneovim-b25753381c6049132c5c8d02eb62df99f8a958fd.tar.gz rneovim-b25753381c6049132c5c8d02eb62df99f8a958fd.tar.bz2 rneovim-b25753381c6049132c5c8d02eb62df99f8a958fd.zip |
fix(api): set script context when using nvim_set_hl (#28123)
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 2b3ebb7bfb..2fb8f3d554 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -167,7 +167,7 @@ Dictionary nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena *arena, E /// @param[out] err Error details, if any /// // TODO(bfredl): val should take update vs reset flag -void nvim_set_hl(Integer ns_id, String name, Dict(highlight) *val, Error *err) +void nvim_set_hl(uint64_t channel_id, Integer ns_id, String name, Dict(highlight) *val, Error *err) FUNC_API_SINCE(7) { int hl_id = syn_check_group(name.data, name.size); @@ -184,7 +184,9 @@ void nvim_set_hl(Integer ns_id, String name, Dict(highlight) *val, Error *err) HlAttrs attrs = dict2hlattrs(val, true, &link_id, err); if (!ERROR_SET(err)) { - ns_hl_def((NS)ns_id, hl_id, attrs, link_id, val); + WITH_SCRIPT_CONTEXT(channel_id, { + ns_hl_def((NS)ns_id, hl_id, attrs, link_id, val); + }); } } |