diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-02-14 07:21:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-13 23:21:45 +0000 |
commit | 9f85dace94d2682f076ede824d3516cdf779ff7b (patch) | |
tree | c68afb77088206a0229731aa1feae600d80c1774 /test | |
parent | 93480f7fbaa5b4e5418d95dd35005daa6142dbb9 (diff) | |
download | rneovim-9f85dace94d2682f076ede824d3516cdf779ff7b.tar.gz rneovim-9f85dace94d2682f076ede824d3516cdf779ff7b.tar.bz2 rneovim-9f85dace94d2682f076ede824d3516cdf779ff7b.zip |
vim-patch:9.1.1108: 'smoothscroll' gets stuck with 'listchars' "eol" (#32434)
Problem: 'smoothscroll' gets stuck with 'listchars' "eol".
Solution: Count size of 'listchars' "eol" in line size when scrolling.
(zeertzjq)
related: neovim/neovim#32405
closes: vim/vim#16627
https://github.com/vim/vim/commit/2c47ab8fcd7188fa87053c757ea86b0d846c06c1
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_scroll_opt.vim | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim index 55f9a32718..14092757a1 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -1219,4 +1219,59 @@ func Test_smooth_long_scrolloff() call StopVimInTerminal(buf) endfunc +func Test_smoothscroll_listchars_eol() + call NewWindow(10, 40) + setlocal list listchars=eol:$ scrolloff=0 smoothscroll + call setline(1, repeat('-', 40)) + call append(1, repeat(['foobar'], 10)) + + normal! G + call assert_equal(2, line('w0')) + call assert_equal(0, winsaveview().skipcol) + + exe "normal! \<C-Y>" + call assert_equal(1, line('w0')) + call assert_equal(40, winsaveview().skipcol) + + exe "normal! \<C-Y>" + call assert_equal(1, line('w0')) + call assert_equal(0, winsaveview().skipcol) + + exe "normal! \<C-Y>" + call assert_equal(1, line('w0')) + call assert_equal(0, winsaveview().skipcol) + + exe "normal! \<C-E>" + call assert_equal(1, line('w0')) + call assert_equal(40, winsaveview().skipcol) + + exe "normal! \<C-E>" + call assert_equal(2, line('w0')) + call assert_equal(0, winsaveview().skipcol) + + for ve in ['', 'all', 'onemore'] + let &virtualedit = ve + normal! gg + call assert_equal(1, line('w0')) + call assert_equal(0, winsaveview().skipcol) + + exe "normal! \<C-E>" + redraw " redrawing should not cause another scroll + call assert_equal(1, line('w0')) + call assert_equal(40, winsaveview().skipcol) + + exe "normal! \<C-E>" + redraw + call assert_equal(2, line('w0')) + call assert_equal(0, winsaveview().skipcol) + + if ve != 'all' + call assert_equal([0, 2, 1, 0], getpos('.')) + endif + endfor + + set virtualedit& + bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |