summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-04-09 21:30:19 +0200
committerChristian Brabandt <cb@256bit.org>2024-04-09 21:30:19 +0200
commit78c51500f1bb16501521d721d52cb0982f5e70b6 (patch)
treedfaa41a80511bfe2c38a7b78ab94eb3160582227 /src/testdir
parent6ce07edd600e73e5aaebeafead6e82b41bd00e12 (diff)
patch 9.1.0285: Still problems with cursor position for CTRL-D/Uv9.1.0285
Problem: Problems with cursor position when scrolling half a page. Solution: Rework the cursor logic. (Luuk van Baal) closes: #14455 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.vim12
-rw-r--r--src/testdir/test_scroll_opt.vim8
2 files changed, 16 insertions, 4 deletions
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index 5b1bb402b6..4f99095415 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -4225,4 +4225,16 @@ func Test_single_line_filler_zb()
bw!
endfunc
+" Test for Ctrl-U not getting stuck at end of buffer with 'scrolloff'.
+func Test_halfpage_scrolloff_eob()
+ set scrolloff=5
+
+ call setline(1, range(1, 100))
+ exe "norm! Gzz\<C-U>zz"
+ call assert_notequal(100, line('.'))
+
+ set scrolloff&
+ bwipe!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab nofoldenable
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index e09c240a09..cda9bf0d78 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -1028,10 +1028,10 @@ func Test_smoothscroll_page()
call assert_equal(415, col('.'))
exe "norm! \<C-D>"
call assert_equal(520, winsaveview().skipcol)
- call assert_equal(535, col('.'))
+ call assert_equal(615, col('.'))
exe "norm! \<C-D>"
call assert_equal(520, winsaveview().skipcol)
- call assert_equal(735, col('.'))
+ call assert_equal(815, col('.'))
exe "norm! \<C-D>"
call assert_equal(520, winsaveview().skipcol)
call assert_equal(895, col('.'))
@@ -1043,10 +1043,10 @@ func Test_smoothscroll_page()
call assert_equal(495, col('.'))
exe "norm! \<C-U>"
call assert_equal(0, winsaveview().skipcol)
- call assert_equal(375, col('.'))
+ call assert_equal(295, col('.'))
exe "norm! \<C-U>"
call assert_equal(0, winsaveview().skipcol)
- call assert_equal(175, col('.'))
+ call assert_equal(95, col('.'))
exe "norm! \<C-U>"
call assert_equal(0, winsaveview().skipcol)
call assert_equal(15, col('.'))