vim-patch:9.1.1388: Scrolling one line too far with 'nosmoothscroll' page scrolling (#34023)

Problem:  One-off error in "count" to make "w_skipcol" zero with
          'nosmoothscroll' page scrolling when last virtual line
          in a buffer line is exactly the entire window width.
          (Hirohito Higashi)
Solution: Properly compute the smallest integer value necessary
          to make "w_skipcol" zero (Luuk van Baal)

c6c72d165c
(cherry picked from commit f87b6230f1)
This commit is contained in:
luukvbaal
2025-05-15 10:01:34 +02:00
committed by github-actions[bot]
parent d50f71d2f1
commit 27abf5c81b
2 changed files with 20 additions and 3 deletions

View File

@@ -4348,4 +4348,21 @@ func Test_scroll_longline_benchmark()
bwipe!
endfunc
" Test Ctrl-B with 'nosmoothscroll' not stuck with line exactly window width.
func Test_scroll_longline_winwidth()
10new
call setline(1, ['']->repeat(20) + ['A'->repeat(20 * winwidth(0))] + ['']->repeat(20))
exe "normal! G3\<C-B>"
call assert_equal(22, line('w0'))
exe "normal! \<C-B>"
call assert_equal(21, line('w0'))
exe "normal! \<C-B>"
call assert_equal(11, line('w0'))
exe "normal! \<C-B>"
call assert_equal(3, line('w0'))
exe "normal! \<C-B>"
call assert_equal(1, line('w0'))
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab nofoldenable