mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
fix(api): set script context when using nvim_set_hl (#28123)
This commit is contained in:
@@ -889,11 +889,13 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id)
|
||||
g->sg_link = link_id;
|
||||
g->sg_script_ctx = current_sctx;
|
||||
g->sg_script_ctx.sc_lnum += SOURCING_LNUM;
|
||||
nlua_set_sctx(&g->sg_script_ctx);
|
||||
g->sg_set |= SG_LINK;
|
||||
if (is_default) {
|
||||
g->sg_deflink = link_id;
|
||||
g->sg_deflink_sctx = current_sctx;
|
||||
g->sg_deflink_sctx.sc_lnum += SOURCING_LNUM;
|
||||
nlua_set_sctx(&g->sg_deflink_sctx);
|
||||
}
|
||||
} else {
|
||||
g->sg_link = 0;
|
||||
@@ -934,6 +936,7 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id)
|
||||
|
||||
g->sg_script_ctx = current_sctx;
|
||||
g->sg_script_ctx.sc_lnum += SOURCING_LNUM;
|
||||
nlua_set_sctx(&g->sg_script_ctx);
|
||||
|
||||
g->sg_attr = hl_get_syn_attr(0, id, attrs);
|
||||
|
||||
|
Reference in New Issue
Block a user