diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-10-29 15:26:57 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-10-29 15:26:57 +0100 |
commit | af2d20c6285c1d2973e3d9b5e8f727e3ed180493 (patch) | |
tree | 63d5f59ae2662b1799728fe8ac7e1144ad09f777 /src/testdir/test_scroll_opt.vim | |
parent | d057301b1f28736f094affa17b190244ad56e8d9 (diff) | |
download | vim-git-af2d20c6285c1d2973e3d9b5e8f727e3ed180493.tar.gz |
patch 8.0.1237: ":set scroll&" often gives an errorv8.0.1237
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)
Diffstat (limited to 'src/testdir/test_scroll_opt.vim')
-rw-r--r-- | src/testdir/test_scroll_opt.vim | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim new file mode 100644 index 000000000..77920eb8b --- /dev/null +++ b/src/testdir/test_scroll_opt.vim @@ -0,0 +1,36 @@ +" Test for reset 'scroll' +" + +func Test_reset_scroll() + let scr = &l:scroll + + setlocal scroll=1 + setlocal scroll& + call assert_equal(scr, &l:scroll) + + setlocal scroll=1 + setlocal scroll=0 + call assert_equal(scr, &l:scroll) + + try + execute 'setlocal scroll=' . (winheight(0) + 1) + " not reached + call assert_false(1) + catch + call assert_exception('E49:') + endtry + + split + + let scr = &l:scroll + + setlocal scroll=1 + setlocal scroll& + call assert_equal(scr, &l:scroll) + + setlocal scroll=1 + setlocal scroll=0 + call assert_equal(scr, &l:scroll) + + quit! +endfunc |