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
(cherry picked from commit 03e7d4fc85)
This commit is contained in:
zeertzjq
2023-08-21 06:15:12 +08:00
committed by github-actions[bot]
parent 016b883def
commit c083d7ac78
5 changed files with 119 additions and 80 deletions

View File

@@ -1556,5 +1556,23 @@ func Test_heap_buffer_overflow()
set updatecount&
endfunc
" Test Visual highlight with cursor at end of screen line and 'showbreak'
func Test_visual_hl_with_showbreak()
CheckScreendump
let lines =<< trim END
setlocal showbreak=+
call setline(1, repeat('a', &columns + 10))
normal g$v4lo
END
call writefile(lines, 'XTest_visual_sbr', 'D')
let buf = RunVimInTerminal('-S XTest_visual_sbr', {'rows': 6, 'cols': 50})
call VerifyScreenDump(buf, 'Test_visual_hl_with_showbreak', {})
" clean up
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab