comparison src/testdir/test_scroll_opt.vim @ 31954:d8fdafc4b390 v9.0.1309

patch 9.0.1309: scrolling two lines with even line count and 'scrolloff' set Commit: https://github.com/vim/vim/commit/1d6539cf36a7b6d1afe76fb6316fe662f543bf60 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Feb 14 17:41:20 2023 +0000 patch 9.0.1309: scrolling two lines with even line count and 'scrolloff' set Problem: Scrolling two lines with even line count and 'scrolloff' set. Solution: Adjust how the topline is computed. (closes https://github.com/vim/vim/issues/10545)
author Bram Moolenaar <Bram@vim.org>
date Tue, 14 Feb 2023 18:45:05 +0100
parents dbec60b8c253
children 8323e235ff44
comparison
equal deleted inserted replaced
31953:80d41e6f9f2a 31954:d8fdafc4b390
34 setlocal scroll=1 34 setlocal scroll=1
35 setlocal scroll=0 35 setlocal scroll=0
36 call assert_equal(scr, &l:scroll) 36 call assert_equal(scr, &l:scroll)
37 37
38 quit! 38 quit!
39 endfunc
40
41 func Test_scolloff_even_line_count()
42 new
43 resize 6
44 setlocal scrolloff=3
45 call setline(1, range(20))
46 normal 2j
47 call assert_equal(1, getwininfo(win_getid())[0].topline)
48 normal j
49 call assert_equal(1, getwininfo(win_getid())[0].topline)
50 normal j
51 call assert_equal(2, getwininfo(win_getid())[0].topline)
52 normal j
53 call assert_equal(3, getwininfo(win_getid())[0].topline)
54
55 bwipe!
39 endfunc 56 endfunc
40 57
41 func Test_CtrlE_CtrlY_stop_at_end() 58 func Test_CtrlE_CtrlY_stop_at_end()
42 enew 59 enew
43 call setline(1, ['one', 'two']) 60 call setline(1, ['one', 'two'])