vim-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)

cb204e688e
This commit is contained in:
Luuk van Baal
2024-04-02 20:58:49 +02:00
parent 7035125b2b
commit e6cfa22c4c
8 changed files with 189 additions and 76 deletions

View File

@@ -1283,13 +1283,9 @@ func Test_vert_scroll_cmds()
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&
@@ -1310,8 +1306,9 @@ func Test_vert_scroll_cmds()
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>"
@@ -3080,8 +3077,7 @@ func Test_normal42_halfpage()
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>"
@@ -3828,7 +3824,7 @@ func Test_normal_vert_scroll_longline()
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())