vim-patch:9.0.1759: Visual highlight not working with cursor at end of screen line

Problem:  Visual highlight not working with cursor at end of screen line
          and 'showbreak'.
Solution: Only update "vcol_prev" when drawing buffer text.

closes: vim/vim#12865

8fc6a1dae0
This commit is contained in:
zeertzjq
2023-08-21 06:15:12 +08:00
parent 18062f70d8
commit 03e7d4fc85
5 changed files with 119 additions and 80 deletions

View File

@@ -9,6 +9,34 @@ local command = helpers.command
describe('display', function()
before_each(clear)
-- oldtest: Test_visual_block_scroll()
it('redraws properly after scrolling with matchparen loaded and scrolloff=1', function()
local screen = Screen.new(30, 7)
screen:attach()
screen:set_default_attr_ids({
[1] = {bold = true},
[2] = {background = Screen.colors.LightGrey},
})
exec([[
source $VIMRUNTIME/plugin/matchparen.vim
set scrolloff=1
call setline(1, ['a', 'b', 'c', 'd', 'e', '', '{', '}', '{', 'f', 'g', '}'])
call cursor(5, 1)
]])
feed('V<c-d><c-d>')
screen:expect([[
{2:{} |
{2:}} |
{2:{} |
{2:f} |
^g |
} |
{1:-- VISUAL LINE --} |
]])
end)
-- oldtest: Test_display_scroll_at_topline()
it('scroll when modified at topline vim-patch:8.2.1488', function()
local screen = Screen.new(20, 4)