fix(drawline): 'statuscolumn' breaks unprintable char wrapping (#41198)

Problem:
Evaluating 'statuscolumn' overwrites transchar_charbuf[], which breaks
the drawing of an unprintable char if p_extra points there.

Solution:
Make a copy in wlv.extra so that it won't be overwritten.
This commit is contained in:
zeertzjq
2026-08-07 12:01:38 +08:00
parent d23507a0f6
commit b8ac44e8c0
2 changed files with 19 additions and 1 deletions

View File

@@ -1130,4 +1130,21 @@ describe('statuscolumn', function()
|
]])
end)
it('does not break wrapping at unprintable chars #41198', function()
command([[let &statuscolumn = repeat(' ', 4)]])
api.nvim_buf_set_lines(0, 0, -1, true, { ('\1'):rep(100), 'foo', 'bar' })
command('normal! zb')
screen:expect([[
{8: }{18:^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^}|
{8: }{18:A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A}|
{8: }{18:^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^}|
{8: }{18:A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A^A}|
{8: }{18:^A^A} |
{8: }foo |
{8: }^bar |
{1:~ }|*6
|
]])
end)
end)