diff options
author | luukvbaal <luukvbaal@gmail.com> | 2023-05-16 01:56:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 07:56:06 +0800 |
commit | 5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f (patch) | |
tree | cb2dc2c09229f952594ef764387fa3433ba42fd1 /test/old | |
parent | bd247d835fd703c62df2bc0fbe3c8c522cc9c7ac (diff) | |
download | rneovim-5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f.tar.gz rneovim-5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f.tar.bz2 rneovim-5887ecab6ddd294f43ff3f2372149ce8c5f8dc7f.zip |
vim-patch:9.0.1561: display wrong when moving cursor to above the top line (#23644)
Problem: Display wrong when moving cursor to above the top line and
'smoothscroll' is set.
Solution: Call adjust_skipcol() in more places and make it work better.
(Luuk van Baal, closes vim/vim#12395)
https://github.com/vim/vim/commit/798fa76dbf737f855e47b10bf326453866b429ab
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_display.vim | 19 | ||||
-rw-r--r-- | test/old/testdir/test_scroll_opt.vim | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/test/old/testdir/test_display.vim b/test/old/testdir/test_display.vim index a2b40521d9..e007b6f741 100644 --- a/test/old/testdir/test_display.vim +++ b/test/old/testdir/test_display.vim @@ -518,14 +518,29 @@ func Test_display_cursor_long_line() CheckScreendump let lines =<< trim END - call setline(1, ['a', 'bbbbb '->repeat(100), 'c']) + call setline(1, ['a', 'b ' .. 'bbbbb'->repeat(150), 'c']) norm $j END call writefile(lines, 'XdispCursorLongline', 'D') let buf = RunVimInTerminal('-S XdispCursorLongline', #{rows: 8}) - call VerifyScreenDump(buf, 'Test_display_cursor_long_line', {}) + call VerifyScreenDump(buf, 'Test_display_cursor_long_line_1', {}) + + " FIXME: moving the cursor above the topline does not set w_skipcol + " correctly with cpo+=n and zero scrolloff (curs_columns() extra == 1). + call term_sendkeys(buf, ":set number cpo+=n scrolloff=0\<CR>") + call term_sendkeys(buf, '$0') + call VerifyScreenDump(buf, 'Test_display_cursor_long_line_2', {}) + + " Going to the start of the line with "b" did not set w_skipcol correctly + " with 'smoothscroll'. + call term_sendkeys(buf, ":set smoothscroll\<CR>") + call term_sendkeys(buf, '$b') + call VerifyScreenDump(buf, 'Test_display_cursor_long_line_3', {}) + " Same for "ge". + call term_sendkeys(buf, '$ge') + call VerifyScreenDump(buf, 'Test_display_cursor_long_line_4', {}) call StopVimInTerminal(buf) endfunc diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim index 13ef4b76df..74c2de81aa 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -502,7 +502,7 @@ func Test_smoothscroll_cursor_position() " regardless of number and cpo-=n. setl number list listchars=precedes:< cpo-=n call s:check_col_calc(5, 1, 1) - exe "normal 2|\<C-E>" + exe "normal 3|\<C-E>h" call s:check_col_calc(6, 1, 18) norm h call s:check_col_calc(5, 2, 17) |