summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-04-20 17:38:20 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-20 17:38:20 +0200
commit4b6b0c4024df08dd8ce49dff3c76356ff81190c4 (patch)
treea82401e59205b519fe1c078a0d2f99ebaa88f480 /src/testdir
parent59356019eb98b02caf086a26402307c5518e9f3a (diff)
patch 9.1.0357: Page scrolling should place cursor at window boundariesv9.1.0357
Problem: Page scrolling does not always place the cursor at the top or bottom of the window (Mathias Rav) Solution: Place the cursor at the top or bottom of the window. (Luuk van Baal) fixes: #14585 closes: #14586 Signed-off-by: Luuk van Baal <luukvbaal@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_normal.vim17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 7fb6a4bf53..4b7e5e6142 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -3813,8 +3813,8 @@ func Test_normal_vert_scroll_longline()
call assert_equal(11, line('.'))
call assert_equal(1, winline())
exe "normal \<C-B>"
- call assert_equal(10, line('.'))
- call assert_equal(4, winline())
+ call assert_equal(11, line('.'))
+ call assert_equal(5, winline())
exe "normal \<C-B>\<C-B>"
call assert_equal(5, line('.'))
call assert_equal(5, winline())
@@ -4247,4 +4247,17 @@ func Test_halfpage_cursor_startend()
bwipe!
endfunc
+" Test for Ctrl-F/B moving the cursor to the window boundaries.
+func Test_page_cursor_topbot()
+ 10new
+ call setline(1, range(1, 100))
+ exe "norm! gg2\<C-F>"
+ call assert_equal(17, line('.'))
+ exe "norm! \<C-B>"
+ call assert_equal(18, line('.'))
+ exe "norm! \<C-B>\<C-F>"
+ call assert_equal(9, line('.'))
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab nofoldenable