mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 19:39:53 +10:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user