mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 00:46:30 +00:00
@@ -738,6 +738,8 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id)
|
|||||||
g->sg_script_ctx = current_sctx;
|
g->sg_script_ctx = current_sctx;
|
||||||
g->sg_script_ctx.sc_lnum += sourcing_lnum;
|
g->sg_script_ctx.sc_lnum += sourcing_lnum;
|
||||||
|
|
||||||
|
g->sg_attr = hl_get_syn_attr(0, id, attrs);
|
||||||
|
|
||||||
// 'Normal' is special
|
// 'Normal' is special
|
||||||
if (STRCMP(g->sg_name_u, "NORMAL") == 0) {
|
if (STRCMP(g->sg_name_u, "NORMAL") == 0) {
|
||||||
cterm_normal_fg_color = g->sg_cterm_fg;
|
cterm_normal_fg_color = g->sg_cterm_fg;
|
||||||
@@ -747,8 +749,6 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id)
|
|||||||
normal_sp = g->sg_rgb_sp;
|
normal_sp = g->sg_rgb_sp;
|
||||||
ui_default_colors_set();
|
ui_default_colors_set();
|
||||||
} else {
|
} else {
|
||||||
g->sg_attr = hl_get_syn_attr(0, id, attrs);
|
|
||||||
|
|
||||||
// a cursor style uses this syn_id, make sure its attribute is updated.
|
// a cursor style uses this syn_id, make sure its attribute is updated.
|
||||||
if (cursor_mode_uses_syn_id(id)) {
|
if (cursor_mode_uses_syn_id(id)) {
|
||||||
ui_mode_info_set();
|
ui_mode_info_set();
|
||||||
|
@@ -337,4 +337,10 @@ describe("API: set highlight", function()
|
|||||||
exec_capture('highlight Test_hl3'))
|
exec_capture('highlight Test_hl3'))
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it ("correctly sets 'Normal' internal properties", function()
|
||||||
|
-- Normal has some special handling internally. #18024
|
||||||
|
meths.set_hl(0, 'Normal', {fg='#000083', bg='#0000F3'})
|
||||||
|
eq({foreground = 131, background = 243}, nvim("get_hl_by_name", 'Normal', true))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user