mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #25491 from glepnir/25474
fix(highlight): attr set all when normal attr changed
This commit is contained in:
commit
3079fa1f9f
@ -866,9 +866,17 @@ void set_hl_group(int id, HlAttrs attrs, Dict(highlight) *dict, int link_id)
|
|||||||
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;
|
||||||
cterm_normal_bg_color = g->sg_cterm_bg;
|
cterm_normal_bg_color = g->sg_cterm_bg;
|
||||||
|
bool did_changed = false;
|
||||||
|
if (normal_bg != g->sg_rgb_bg || normal_fg != g->sg_rgb_fg || normal_sp != g->sg_rgb_sp) {
|
||||||
|
did_changed = true;
|
||||||
|
}
|
||||||
normal_fg = g->sg_rgb_fg;
|
normal_fg = g->sg_rgb_fg;
|
||||||
normal_bg = g->sg_rgb_bg;
|
normal_bg = g->sg_rgb_bg;
|
||||||
normal_sp = g->sg_rgb_sp;
|
normal_sp = g->sg_rgb_sp;
|
||||||
|
|
||||||
|
if (did_changed) {
|
||||||
|
highlight_attr_set_all();
|
||||||
|
}
|
||||||
ui_default_colors_set();
|
ui_default_colors_set();
|
||||||
} else {
|
} else {
|
||||||
// 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.
|
||||||
|
@ -2523,6 +2523,8 @@ describe('highlight namespaces', function()
|
|||||||
[6] = {bold = true, reverse = true};
|
[6] = {bold = true, reverse = true};
|
||||||
[7] = {reverse = true};
|
[7] = {reverse = true};
|
||||||
[8] = {foreground = Screen.colors.Gray20};
|
[8] = {foreground = Screen.colors.Gray20};
|
||||||
|
[9] = {foreground = Screen.colors.Blue};
|
||||||
|
[10] = {bold = true, foreground = Screen.colors.SeaGreen};
|
||||||
}
|
}
|
||||||
|
|
||||||
ns1 = meths.create_namespace 'grungy'
|
ns1 = meths.create_namespace 'grungy'
|
||||||
@ -2655,4 +2657,21 @@ describe('highlight namespaces', function()
|
|||||||
"Normal:Visual",
|
"Normal:Visual",
|
||||||
},res)
|
},res)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('Normal in set_hl #25474', function()
|
||||||
|
meths.set_hl(0, 'Normal', {bg='#333333'})
|
||||||
|
command('highlight Ignore')
|
||||||
|
screen:expect{grid=[[
|
||||||
|
|
|
||||||
|
{1:~ }|
|
||||||
|
{1:~ }|
|
||||||
|
{6: }|
|
||||||
|
|
|
||||||
|
Ignore {8:xxx} {9:ctermf}|
|
||||||
|
{9:g=}15 {9:guifg=}|
|
||||||
|
bg |
|
||||||
|
{10:Press ENTER or type comma}|
|
||||||
|
{10:nd to continue}^ |
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user