aboutsummaryrefslogtreecommitdiff
path: root/test/old/testdir/test_normal.vim
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2024-03-26 19:06:39 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2024-03-28 10:18:09 +0100
commit4147302f4be3fe8a5dae3f20a336477cb5f507a4 (patch)
tree694d7ad69b0ef3e3158c9bee7d6812be9ed2db83 /test/old/testdir/test_normal.vim
parent19b443251fe0405628a0aa90583e6c6512dd0fd0 (diff)
downloadrneovim-4147302f4be3fe8a5dae3f20a336477cb5f507a4.tar.gz
rneovim-4147302f4be3fe8a5dae3f20a336477cb5f507a4.tar.bz2
rneovim-4147302f4be3fe8a5dae3f20a336477cb5f507a4.zip
vim-patch:9.1.0211: page-wise scrolling does not support smooth-scrolling
Problem: Page-wise scrolling with Ctrl-F/Ctrl-B implements it's own logic to change the topline and cursor. In doing so, skipcol is not handled properly for 'smoothscroll', and virtual lines. Solution: Re-use the logic from Ctrl-E/Ctrl-Y while staying backward compatible as much as possible. https://github.com/vim/vim/commit/b9f5b95b7bec2414a5a96010514702d99afea18e
Diffstat (limited to 'test/old/testdir/test_normal.vim')
-rw-r--r--test/old/testdir/test_normal.vim32
1 files changed, 20 insertions, 12 deletions
diff --git a/test/old/testdir/test_normal.vim b/test/old/testdir/test_normal.vim
index d31ae488d9..644a632413 100644
--- a/test/old/testdir/test_normal.vim
+++ b/test/old/testdir/test_normal.vim
@@ -131,7 +131,7 @@ func Test_normal01_keymodel()
call assert_equal([0, 1, 1, 0], getpos("'<"))
call assert_equal([0, 3, 1, 0], getpos("'>"))
call feedkeys("Gz\<CR>8|\<S-PageUp>y", 'xt')
- call assert_equal([0, 2, 1, 0], getpos("'<"))
+ call assert_equal([0, 3, 1, 0], getpos("'<"))
call assert_equal([0, 3, 8, 0], getpos("'>"))
" Test for <S-C-Home> and <S-C-End>
call cursor(2, 12)
@@ -915,12 +915,10 @@ func Test_normal14_page()
set scrolloff=0
100
exe "norm! $\<c-b>"
- call assert_equal('92', getline('.'))
call assert_equal([0, 92, 1, 0, 1], getcurpos())
100
set nostartofline
exe "norm! $\<c-b>"
- call assert_equal('92', getline('.'))
call assert_equal([0, 92, 2, 0, v:maxcol], getcurpos())
" cleanup
set startofline
@@ -3825,11 +3823,11 @@ 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(3, winline())
+ call assert_equal(11, line('.'))
+ call assert_equal(9, winline())
exe "normal \<C-B>\<C-B>"
call assert_equal(5, line('.'))
- call assert_equal(5, winline())
+ call assert_equal(1, winline())
bwipe!
endfunc
@@ -4182,20 +4180,30 @@ func Test_normal34_zet_large()
norm! z9765405999999999999
endfunc
-" Test for { and } paragraph movements in a single line
-func Test_brace_single_line()
- let text =<< trim [DATA]
- foobar one two three
- [DATA]
+" Test for { and } paragraph movements and Ctrl-B in buffer with a single line
+func Test_single_line_scroll()
+ CheckFeature textprop
new
- call setline(1, text)
+ call setline(1, ['foobar one two three'])
+ let vt = 'virt_above'
+ call prop_type_add(vt, {'highlight': 'IncSearch'})
+ call prop_add(1, 0, {'type': vt, 'text': '---', 'text_align': 'above'})
1
norm! 0}
call assert_equal([0, 1, 20, 0], getpos('.'))
norm! {
call assert_equal([0, 1, 1, 0], getpos('.'))
+
+ " Ctrl-B scrolls 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)
+
+ set smoothscroll&
bw!
endfunc