fix(column): crash with 'signcolumn' set to "number" (#29003)

Problem:  Numberwidth may depend on number of signs with text in the
          buffer and is not handled correctly for extmark signs.
Solution: Move legacy sign code for changed numberwidth so that it is
          handled properly for legacy and extmark signs alike.
(cherry picked from commit f2083bd55c)
This commit is contained in:
luukvbaal
2024-06-01 12:10:35 +02:00
committed by github-actions[bot]
parent 58e1ef2f65
commit df6ce8377f
5 changed files with 41 additions and 29 deletions

View File

@@ -5497,6 +5497,26 @@ l5
api.nvim_buf_clear_namespace(0, ns, 0, -1)
end)
it([[correct numberwidth with 'signcolumn' set to "number" #28984]], function()
command('set number numberwidth=1 signcolumn=number')
api.nvim_buf_set_extmark(0, ns, 0, 0, { sign_text = 'S1' })
screen:expect({
grid = [[
S1 ^ |
{1:~ }|*8
|
]]
})
api.nvim_buf_del_extmark(0, ns, 1)
screen:expect({
grid = [[
{8:1 }^ |
{1:~ }|*8
|
]]
})
end)
end)
describe('decorations: virt_text', function()