patch 9.1.0258: half-page scrolling broke backward compatibility
Problem: Support for 'smoothscroll' in (half-)page scrolling
broke backward compatibility and can be made to work better.
(after v9.1.215)
Solution: Restore the previous cursor and end-of-buffer behavior for
half-page scrolling and improve 'smoothscroll' support.
(Luuk van Baal)
fixes: #14338
closes: #14377
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 14440fb..1acdfce 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -1280,13 +1280,9 @@
exe "normal \<C-D>"
call assert_equal(46, line('.'))
exe "normal \<C-U>"
- call assert_equal(36, line('w0'))
- call assert_equal(46, line('.'))
+ call assert_equal(36, line('.'))
exe "normal \<C-U>"
- call assert_equal(1, line('w0'))
- call assert_equal(40, line('.'))
- exe "normal \<C-U>"
- call assert_equal(30, line('.'))
+ call assert_equal(1, line('.'))
exe "normal \<C-U>"
call assert_equal(1, line('.'))
set scroll&
@@ -1307,8 +1303,9 @@
call assert_equal(50, line('.'))
call assert_equal(100, line('w$'))
normal z.
+ let lnum = winline()
exe "normal \<C-D>"
- call assert_equal(1, winline())
+ call assert_equal(lnum, winline())
call assert_equal(50, line('.'))
normal zt
exe "normal \<C-D>"
@@ -3069,8 +3066,7 @@
call assert_equal(2, &scroll)
set scroll=5
exe "norm! \<c-u>"
- call assert_equal('3', getline('w0'))
- call assert_equal('8', getline('.'))
+ call assert_equal('3', getline('.'))
1
set scrolloff=5
exe "norm! \<c-d>"
@@ -3818,7 +3814,7 @@
call assert_equal(1, winline())
exe "normal \<C-B>"
call assert_equal(10, line('.'))
- call assert_equal(10, winline())
+ call assert_equal(4, winline())
exe "normal \<C-B>\<C-B>"
call assert_equal(5, line('.'))
call assert_equal(5, winline())