patch 9.1.0215: Half-page scrolling does not support smooth-scrolling
Problem: Page-wise scrolling with Ctrl-D/Ctrl-U implements
it's own logic to change the topline and cursor.
More logic than necessary for scrolling with Ctrl-F/Ctrl-B
was removed in patch 9.1.0211.
Solution: Re-use the logic from Ctrl-E/Ctrl-Y/Ctrl-F/Ctrl-B while
staying backward compatible as much as possible.
Restore some of the logic that determined how many lines will
be scrolled (Luuk van Baal)
closes: #14316
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index 2480495..788870f 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -1005,18 +1005,39 @@
call setline(1, 'abcde '->repeat(150))
exe "norm! \<C-F>"
- call assert_equal(320, winsaveview().skipcol)
+ call assert_equal(400, winsaveview().skipcol)
exe "norm! \<C-F>"
- call assert_equal(640, winsaveview().skipcol)
+ call assert_equal(800, winsaveview().skipcol)
exe "norm! \<C-F>"
call assert_equal(880, winsaveview().skipcol)
exe "norm! \<C-B>"
- call assert_equal(560, winsaveview().skipcol)
+ call assert_equal(480, winsaveview().skipcol)
exe "norm! \<C-B>"
- call assert_equal(240, winsaveview().skipcol)
+ call assert_equal(80, winsaveview().skipcol)
exe "norm! \<C-B>"
call assert_equal(0, winsaveview().skipcol)
+ exe "norm! \<C-D>"
+ call assert_equal(200, winsaveview().skipcol)
+ exe "norm! \<C-D>"
+ call assert_equal(400, winsaveview().skipcol)
+ exe "norm! \<C-D>"
+ call assert_equal(600, winsaveview().skipcol)
+ exe "norm! \<C-D>"
+ call assert_equal(800, winsaveview().skipcol)
+ exe "norm! \<C-D>"
+ call assert_equal(880, winsaveview().skipcol)
+ exe "norm! \<C-U>"
+ call assert_equal(680, winsaveview().skipcol)
+ exe "norm! \<C-U>"
+ call assert_equal(480, winsaveview().skipcol)
+ exe "norm! \<C-U>"
+ call assert_equal(280, winsaveview().skipcol)
+ exe "norm! \<C-U>"
+ call assert_equal(80, winsaveview().skipcol)
+ exe "norm! \<C-U>"
+ call assert_equal(0, winsaveview().skipcol)
+
set smoothscroll&
endfunc