From c126a3756a09716ed64fd2acb9eee5d411c4aa7b Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Thu, 23 Nov 2023 12:58:17 +0100 Subject: [PATCH] fix(column): apply numhl signs when 'signcolumn' is "no" (#26167) --- src/nvim/decoration.c | 4 +--- test/functional/ui/sign_spec.lua | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/nvim/decoration.c b/src/nvim/decoration.c index 0f4bbaaac7..43b07501a0 100644 --- a/src/nvim/decoration.c +++ b/src/nvim/decoration.c @@ -713,9 +713,7 @@ void decor_redraw_signs(win_T *wp, buf_T *buf, int row, SignTextAttrs sattrs[], int *cul_id, int *num_id) { MarkTreeIter itr[1]; - if (!buf->b_signs - || wp->w_minscwidth == SCL_NO - || !marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) { + if (!buf->b_signs || !marktree_itr_get_overlap(buf->b_marktree, row, 0, itr)) { return; } diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index 31b54ce0a2..adab184a4c 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -685,4 +685,21 @@ describe('Signs', function() | ]]) 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)