fix(column): apply numhl signs when 'signcolumn' is "no" (#26167)

This commit is contained in:
luukvbaal 2023-11-23 12:58:17 +01:00 committed by GitHub
parent 62dc1f2663
commit c126a3756a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 3 deletions

View File

@ -713,9 +713,7 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[],
int *cul_id, int *num_id) int *cul_id, int *num_id)
{ {
MarkTreeIter itr[1]; MarkTreeIter itr[1];
if (!buf->b_signs if (!buf->b_signs || !marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) {
|| wp->w_minscwidth == SCL_NO
|| !marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) {
return; return;
} }

View File

@ -685,4 +685,21 @@ describe('Signs', function()
| |
]]) ]])
end) end)
it('numhl highlight is applied when signcolumn=no', function()
screen:try_resize(screen._width, 4)
command([[
set nu scl=no
call setline(1, ['line1', 'line2', 'line3'])
call nvim_buf_set_extmark(0, nvim_create_namespace('test'), 0, 0, {'number_hl_group':'Error'})
call sign_define('foo', { 'text':'F', 'numhl':'Error' })
call sign_place(0, '', 'foo', bufnr(''), { 'lnum':2 })
]])
screen:expect([[
{8: 1 }^line1 |
{8: 2 }line2 |
{6: 3 }line3 |
|
]])
end)
end) end)