comparison src/testdir/test_scroll_opt.vim @ 12718:f8f505ffc0a6 v8.0.1237

patch 8.0.1237: ":set scroll&" often gives an error commit https://github.com/vim/vim/commit/af2d20c6285c1d2973e3d9b5e8f727e3ed180493 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Oct 29 15:26:57 2017 +0100 patch 8.0.1237: ":set scroll&" often gives an error Problem: ":set scroll&" often gives an error. Solution: Don't use a fixed default value, use half the window height. Add a test. (Ozaki Kiichi, closes #2104)
author Christian Brabandt <cb@256bit.org>
date Sun, 29 Oct 2017 15:30:04 +0100
parents
children 08940efa6b4e
comparison
equal deleted inserted replaced
12717:a4882c034ad0 12718:f8f505ffc0a6
1 " Test for reset 'scroll'
2 "
3
4 func Test_reset_scroll()
5 let scr = &l:scroll
6
7 setlocal scroll=1
8 setlocal scroll&
9 call assert_equal(scr, &l:scroll)
10
11 setlocal scroll=1
12 setlocal scroll=0
13 call assert_equal(scr, &l:scroll)
14
15 try
16 execute 'setlocal scroll=' . (winheight(0) + 1)
17 " not reached
18 call assert_false(1)
19 catch
20 call assert_exception('E49:')
21 endtry
22
23 split
24
25 let scr = &l:scroll
26
27 setlocal scroll=1
28 setlocal scroll&
29 call assert_equal(scr, &l:scroll)
30
31 setlocal scroll=1
32 setlocal scroll=0
33 call assert_equal(scr, &l:scroll)
34
35 quit!
36 endfunc