summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_normal.vim
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-03-28 10:07:29 +0100
committerChristian Brabandt <cb@256bit.org>2024-03-28 10:10:40 +0100
commit5a2e3ec9ac72b6e644fea4ebba7e632498296e2f (patch)
tree60995794ab4c3a4e3b53156b2b1b2fd4410d0ed1 /src/testdir/test_normal.vim
parent982e191b38b493d148d73871a724381214e4c62f (diff)
patch 9.1.0215: Half-page scrolling does not support smooth-scrollingv9.1.0215
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>
Diffstat (limited to 'src/testdir/test_normal.vim')
-rw-r--r--src/testdir/test_normal.vim26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index dd2f2be2f9..3a7248fd08 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -1280,9 +1280,13 @@ func Test_vert_scroll_cmds()
exe "normal \<C-D>"
call assert_equal(46, line('.'))
exe "normal \<C-U>"
- call assert_equal(36, line('.'))
+ call assert_equal(36, line('w0'))
+ call assert_equal(46, line('.'))
exe "normal \<C-U>"
- call assert_equal(10, line('.'))
+ call assert_equal(1, line('w0'))
+ call assert_equal(40, line('.'))
+ exe "normal \<C-U>"
+ call assert_equal(30, line('.'))
exe "normal \<C-U>"
call assert_equal(1, line('.'))
set scroll&
@@ -1303,9 +1307,8 @@ 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(lnum, winline())
+ call assert_equal(1, winline())
call assert_equal(50, line('.'))
normal zt
exe "normal \<C-D>"
@@ -3066,7 +3069,8 @@ func Test_normal42_halfpage()
call assert_equal(2, &scroll)
set scroll=5
exe "norm! \<c-u>"
- call assert_equal('3', getline('.'))
+ call assert_equal('3', getline('w0'))
+ call assert_equal('8', getline('.'))
1
set scrolloff=5
exe "norm! \<c-d>"
@@ -3813,11 +3817,11 @@ func Test_normal_vert_scroll_longline()
call assert_equal(11, line('.'))
call assert_equal(1, winline())
exe "normal \<C-B>"
- call assert_equal(11, line('.'))
- call assert_equal(9, winline())
+ call assert_equal(10, line('.'))
+ call assert_equal(10, winline())
exe "normal \<C-B>\<C-B>"
call assert_equal(5, line('.'))
- call assert_equal(1, winline())
+ call assert_equal(5, winline())
bwipe!
endfunc
@@ -4186,12 +4190,16 @@ func Test_single_line_scroll()
norm! {
call assert_equal([0, 1, 1, 0], getpos('.'))
- " Ctrl-B scrolls up with hidden "above" virtual text.
+ " Ctrl-B/Ctrl-U scroll up with hidden "above" virtual text.
set smoothscroll
exe "normal \<C-E>"
call assert_notequal(0, winsaveview().skipcol)
exe "normal \<C-B>"
call assert_equal(0, winsaveview().skipcol)
+ exe "normal \<C-E>"
+ call assert_notequal(0, winsaveview().skipcol)
+ exe "normal \<C-U>"
+ call assert_equal(0, winsaveview().skipcol)
set smoothscroll&
bw!