vim-patch:9.0.1825: wrong cursor position with virt text and 'linebreak' (#24957)

Problem:  Wrong cursor position with virtual text before a whitespace
          character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
          adding the size of 'breakindent' and 'showbreak'.

closes: vim/vim#12956

6e55e85f92

N/A patches:
vim-patch:9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
This commit is contained in:
zeertzjq
2023-08-31 08:35:08 +08:00
committed by GitHub
parent 5d49542b56
commit 839d919098
2 changed files with 71 additions and 51 deletions

View File

@@ -3217,6 +3217,33 @@ describe('decorations: inline virtual text', function()
|
]]}
end)
it('before a space with linebreak', function()
screen:try_resize(50, 6)
exec([[
setlocal linebreak showbreak=+ breakindent breakindentopt=shift:2
call setline(1, repeat('a', 50) .. ' ' .. repeat('c', 45))
normal! $
]])
meths.buf_set_extmark(0, ns, 0, 50, { virt_text = { { ('b'):rep(10) } }, virt_text_pos = 'inline' })
screen:expect{grid=[[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa|
{1:+}bbbbbbbbbb |
{1:+}cccccccccccccccccccccccccccccccccccccccccccc^c |
{1:~ }|
{1:~ }|
|
]]}
feed('05x$')
screen:expect{grid=[[
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb|
{1:+}bbbbb |
{1:+}cccccccccccccccccccccccccccccccccccccccccccc^c |
{1:~ }|
{1:~ }|
|
]]}
end)
end)
describe('decorations: virtual lines', function()