aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-16 08:37:42 +0800
committerGitHub <noreply@github.com>2023-02-16 08:37:42 +0800
commit5dc4eaf386d70b9bbef321a00bcbb5d475f36542 (patch)
tree4dd105e8c45b6f7b47f22afeb18b3bfcc8c0144f /src/nvim/testdir
parentf1c5887377c9ae547a7564ec4fc52d72656a974f (diff)
parent0bb3a373d32e150af3909e3873be91f34df211dc (diff)
downloadrneovim-5dc4eaf386d70b9bbef321a00bcbb5d475f36542.tar.gz
rneovim-5dc4eaf386d70b9bbef321a00bcbb5d475f36542.tar.bz2
rneovim-5dc4eaf386d70b9bbef321a00bcbb5d475f36542.zip
Merge pull request #22275 from zeertzjq/vim-9.0.1309
vim-patch:9.0.{1309,1310,1312}: scrolling two lines with even line count and 'scrolloff'
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_scroll_opt.vim20
-rw-r--r--src/nvim/testdir/test_scrollbind.vim4
-rw-r--r--src/nvim/testdir/test_window_cmd.vim4
3 files changed, 23 insertions, 5 deletions
diff --git a/src/nvim/testdir/test_scroll_opt.vim b/src/nvim/testdir/test_scroll_opt.vim
index 77920eb8b0..64f4ced470 100644
--- a/src/nvim/testdir/test_scroll_opt.vim
+++ b/src/nvim/testdir/test_scroll_opt.vim
@@ -1,5 +1,4 @@
" Test for reset 'scroll'
-"
func Test_reset_scroll()
let scr = &l:scroll
@@ -34,3 +33,22 @@ func Test_reset_scroll()
quit!
endfunc
+
+func Test_scolloff_even_line_count()
+ new
+ resize 6
+ setlocal scrolloff=3
+ call setline(1, range(20))
+ normal 2j
+ call assert_equal(1, getwininfo(win_getid())[0].topline)
+ normal j
+ call assert_equal(1, getwininfo(win_getid())[0].topline)
+ normal j
+ call assert_equal(2, getwininfo(win_getid())[0].topline)
+ normal j
+ call assert_equal(3, getwininfo(win_getid())[0].topline)
+
+ bwipe!
+endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/nvim/testdir/test_scrollbind.vim b/src/nvim/testdir/test_scrollbind.vim
index 6c5488be05..f67a559c60 100644
--- a/src/nvim/testdir/test_scrollbind.vim
+++ b/src/nvim/testdir/test_scrollbind.vim
@@ -217,8 +217,8 @@ end of window 2
\ '7 line 02 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02',
\ '56789ABCDEFGHIJKLMNOPQRSTUVWXYZ 02',
\ 'UTSRQPONMLKJIHGREDCBA9876543210 02',
- \ '. line 11 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 11',
- \ '. line 11 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 11',
+ \ '. line 10 ZYXWVUTSRQPONMLKJIHGREDCBA9876543210 10',
+ \ '. line 10 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ 10',
\ ''], getline(1, '$'))
enew!
diff --git a/src/nvim/testdir/test_window_cmd.vim b/src/nvim/testdir/test_window_cmd.vim
index c25b1f1157..8b9457ae1d 100644
--- a/src/nvim/testdir/test_window_cmd.vim
+++ b/src/nvim/testdir/test_window_cmd.vim
@@ -1651,9 +1651,9 @@ func Test_splitkeep_options()
call assert_equal(1, line("w0"))
call assert_equal(curpos, getcurpos())
- " Scroll when cursor becomes invalid in insert mode
+ " Scroll when cursor becomes invalid in insert mode.
norm Lic
- call assert_equal(curpos, getcurpos())
+ call assert_equal(curpos, getcurpos(), 'run ' .. run)
" No scroll when topline not equal to 1
only | execute "norm gg5\<C-e>" | split | wincmd k