diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-19 18:42:54 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-19 19:28:01 +0200 |
commit | cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec (patch) | |
tree | 95b2d868504355e89385fb377b46527e8cf60087 /test/old/testdir/test_scroll_opt.vim | |
parent | 02ef104d5bcd40c048e8011e0106f30389034674 (diff) | |
download | rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.tar.gz rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.tar.bz2 rneovim-cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec.zip |
vim-patch:9.0.1568: with 'smoothscroll' cursor may move below botline
Problem: With 'smoothscroll' cursor may move below botline.
Solution: Call redraw_later() if needed, Compute cursor row with adjusted
condition. (Luuk van Baal, closes vim/vim#12415)
https://github.com/vim/vim/commit/d49f646bf56b29d44bbb16e79bc877b59aab38ac
Diffstat (limited to 'test/old/testdir/test_scroll_opt.vim')
-rw-r--r-- | test/old/testdir/test_scroll_opt.vim | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim index 74c2de81aa..5ac80764b5 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -257,11 +257,14 @@ func Test_smoothscroll_wrap_scrolloff_zero() call term_sendkeys(buf, "G") call VerifyScreenDump(buf, 'Test_smooth_wrap_4', {}) - " moving cursor up right after the >>> marker - no need to show whole line + call term_sendkeys(buf, "4\<C-Y>G") + call VerifyScreenDump(buf, 'Test_smooth_wrap_4', {}) + + " moving cursor up right after the <<< marker - no need to show whole line call term_sendkeys(buf, "2gj3l2k") call VerifyScreenDump(buf, 'Test_smooth_wrap_5', {}) - " moving cursor up where the >>> marker is - whole top line shows + " moving cursor up where the <<< marker is - whole top line shows call term_sendkeys(buf, "2j02k") call VerifyScreenDump(buf, 'Test_smooth_wrap_6', {}) @@ -705,4 +708,30 @@ func Test_smoothscroll_eob() call StopVimInTerminal(buf) endfunc +" skipcol should not reset when doing incremental search on the same word +func Test_smoothscroll_incsearch() + CheckScreendump + + let lines =<< trim END + set smoothscroll number scrolloff=0 incsearch + call setline(1, repeat([''], 20)) + call setline(11, repeat('a', 100)) + call setline(14, 'bbbb') + END + call writefile(lines, 'XSmoothIncsearch', 'D') + let buf = RunVimInTerminal('-S XSmoothIncsearch', #{rows: 8, cols:40}) + + call term_sendkeys(buf, "/b") + call VerifyScreenDump(buf, 'Test_smooth_incsearch_1', {}) + call term_sendkeys(buf, "b") + call VerifyScreenDump(buf, 'Test_smooth_incsearch_2', {}) + call term_sendkeys(buf, "b") + call VerifyScreenDump(buf, 'Test_smooth_incsearch_3', {}) + call term_sendkeys(buf, "b") + call VerifyScreenDump(buf, 'Test_smooth_incsearch_4', {}) + call term_sendkeys(buf, "\<CR>") + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |