aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2018-06-03 19:31:37 -0400
committerJustin M. Keyes <justinkz@gmail.com>2018-06-04 01:31:37 +0200
commit7795829767818a3c6cbeed7957a1ad5c03d48d41 (patch)
tree9c79b6783dc90c93c5db95f6f9b03e48898a1e43 /src/nvim/testdir
parent807a16dbc1c6acdf573f6601cb3e6e15843800d6 (diff)
downloadrneovim-7795829767818a3c6cbeed7957a1ad5c03d48d41.tar.gz
rneovim-7795829767818a3c6cbeed7957a1ad5c03d48d41.tar.bz2
rneovim-7795829767818a3c6cbeed7957a1ad5c03d48d41.zip
vim-patch:8.0.1237: ":set scroll&" often gives an error (#8473)
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 vim/vim#2104) https://github.com/vim/vim/commit/af2d20c6285c1d2973e3d9b5e8f727e3ed180493
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_alot.vim1
-rw-r--r--src/nvim/testdir/test_scroll_opt.vim36
2 files changed, 37 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim
index b4baf7a8d7..c4b4a43ad4 100644
--- a/src/nvim/testdir/test_alot.vim
+++ b/src/nvim/testdir/test_alot.vim
@@ -27,6 +27,7 @@ source test_popup.vim
source test_put.vim
source test_recover.vim
source test_regexp_utf8.vim
+source test_scroll_opt.vim
source test_source_utf8.vim
source test_sha256.vim
source test_statusline.vim
diff --git a/src/nvim/testdir/test_scroll_opt.vim b/src/nvim/testdir/test_scroll_opt.vim
new file mode 100644
index 0000000000..77920eb8b0
--- /dev/null
+++ b/src/nvim/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