mirror of
https://github.com/neovim/neovim
synced 2025-07-18 10:11:50 +00:00
fix(decorations): do not apply sign highlight id as range attr id
This commit is contained in:
@ -781,9 +781,6 @@ Integer nvim_buf_set_extmark(Buffer buffer, Integer ns_id, Integer line, Integer
|
|||||||
DecorSignHighlight sh = decor_sh_from_inline(hl);
|
DecorSignHighlight sh = decor_sh_from_inline(hl);
|
||||||
decor_range_add_sh(&decor_state, r, c, line2, col2, &sh, true, (uint32_t)ns_id, id);
|
decor_range_add_sh(&decor_state, r, c, line2, col2, &sh, true, (uint32_t)ns_id, id);
|
||||||
}
|
}
|
||||||
if (sign.flags & kSHIsSign) {
|
|
||||||
decor_range_add_sh(&decor_state, r, c, line2, col2, &sign, true, (uint32_t)ns_id, id);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (opts->ephemeral) {
|
if (opts->ephemeral) {
|
||||||
api_set_error(err, kErrorTypeException, "not yet implemented");
|
api_set_error(err, kErrorTypeException, "not yet implemented");
|
||||||
|
@ -537,6 +537,10 @@ void decor_range_add_virt(DecorState *state, int start_row, int start_col, int e
|
|||||||
void decor_range_add_sh(DecorState *state, int start_row, int start_col, int end_row, int end_col,
|
void decor_range_add_sh(DecorState *state, int start_row, int start_col, int end_row, int end_col,
|
||||||
DecorSignHighlight *sh, bool owned, uint32_t ns, uint32_t mark_id)
|
DecorSignHighlight *sh, bool owned, uint32_t ns, uint32_t mark_id)
|
||||||
{
|
{
|
||||||
|
if (sh->flags & kSHIsSign) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
DecorRange range = {
|
DecorRange range = {
|
||||||
.start_row = start_row, .start_col = start_col, .end_row = end_row, .end_col = end_col,
|
.start_row = start_row, .start_col = start_col, .end_row = end_row, .end_col = end_col,
|
||||||
.kind = kDecorKindHighlight,
|
.kind = kDecorKindHighlight,
|
||||||
@ -547,7 +551,7 @@ void decor_range_add_sh(DecorState *state, int start_row, int start_col, int end
|
|||||||
.draw_col = -10,
|
.draw_col = -10,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sh->hl_id || (sh->flags & (kSHIsSign | kSHConceal | kSHSpellOn | kSHSpellOff))) {
|
if (sh->hl_id || (sh->flags & (kSHConceal | kSHSpellOn | kSHSpellOff))) {
|
||||||
if (sh->hl_id) {
|
if (sh->hl_id) {
|
||||||
range.attr_id = syn_id2attr(sh->hl_id);
|
range.attr_id = syn_id2attr(sh->hl_id);
|
||||||
}
|
}
|
||||||
|
@ -2155,6 +2155,17 @@ describe('extmark decorations', function()
|
|||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('works with both hl_group and sign_hl_group', function()
|
||||||
|
screen:try_resize(screen._width, 3)
|
||||||
|
insert('abcdefghijklmn')
|
||||||
|
meths.buf_set_extmark(0, ns, 0, 0, {sign_text='S', sign_hl_group='NonText', hl_group='Error', end_col=14})
|
||||||
|
screen:expect{grid=[[
|
||||||
|
{1:S }{4:abcdefghijklm^n} |
|
||||||
|
{1:~ }|
|
||||||
|
|
|
||||||
|
]]}
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('decorations: inline virtual text', function()
|
describe('decorations: inline virtual text', function()
|
||||||
@ -4966,7 +4977,6 @@ l5
|
|||||||
|
|
|
|
||||||
]]}
|
]]}
|
||||||
end)
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('decorations: virt_text', function()
|
describe('decorations: virt_text', function()
|
||||||
|
Reference in New Issue
Block a user