vim-patch:8.2.4630: 'cursorline' not always updated with 'culopt' is "screenline"

Problem:    'cursorline' not always updated with 'cursorlineopt' is
            "screenline".
Solution:   Call check_redraw_cursorline() more often. (closes vim/vim#10013)
bf269ed0b0

Code was reverted in patch 8.2.4638, so this just ports the test.
This commit is contained in:
zeertzjq
2022-03-28 05:10:15 +08:00
parent 4baeb96c1b
commit ab02b28b4e
2 changed files with 70 additions and 10 deletions

View File

@@ -293,5 +293,26 @@ func Test_cursorline_callback()
call delete('Xcul_timer')
endfunc
func Test_cursorline_screenline_update()
CheckScreendump
let lines =<< trim END
call setline(1, repeat('xyz ', 30))
set cursorline cursorlineopt=screenline
inoremap <F2> <Cmd>call cursor(1, 1)<CR>
END
call writefile(lines, 'Xcul_screenline')
let buf = RunVimInTerminal('-S Xcul_screenline', #{rows: 8})
call term_sendkeys(buf, "A")
call VerifyScreenDump(buf, 'Test_cursorline_screenline_1', {})
call term_sendkeys(buf, "\<F2>")
call VerifyScreenDump(buf, 'Test_cursorline_screenline_2', {})
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
call delete('Xcul_screenline')
endfunc
" vim: shiftwidth=2 sts=2 expandtab