aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_scrollbind.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-02 00:57:49 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 15:27:56 +0100
commitcbecae46f4b098cd6018055c7f4c70bd147c7938 (patch)
tree738da5fd30a7cbb66a7a6d456461ce3049bcf770 /src/nvim/testdir/test_scrollbind.vim
parent4fe4b5abb6845b51af195e77576179ff5281451e (diff)
downloadrneovim-cbecae46f4b098cd6018055c7f4c70bd147c7938.tar.gz
rneovim-cbecae46f4b098cd6018055c7f4c70bd147c7938.tar.bz2
rneovim-cbecae46f4b098cd6018055c7f4c70bd147c7938.zip
vim-patch:8.0.0861: still many old style tests
Problem: Still many old style tests. Solution: Convert several tests to new style. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/4a137b45864310060410f34cb9c7d0f0231bb256 vim-patch:8.0.0862: file size test fails on MS-Windows Problem: File size test fails on MS-Windows. Solution: Set fileformat after opening new buffer. Strip CR. https://github.com/vim/vim/commit/07c043af5f054c7dfeb676414f8fa6aeda8f9c2b
Diffstat (limited to 'src/nvim/testdir/test_scrollbind.vim')
-rw-r--r--src/nvim/testdir/test_scrollbind.vim32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_scrollbind.vim b/src/nvim/testdir/test_scrollbind.vim
new file mode 100644
index 0000000000..baa24f1979
--- /dev/null
+++ b/src/nvim/testdir/test_scrollbind.vim
@@ -0,0 +1,32 @@
+" Test for 'scrollbind' causing an unexpected scroll of one of the windows.
+func Test_scrollbind()
+ " We don't want the status line to cause problems:
+ set laststatus=0
+ let totalLines = &lines * 20
+ let middle = totalLines / 2
+ new | only
+ for i in range(1, totalLines)
+ call setline(i, 'LINE ' . i)
+ endfor
+ exe string(middle)
+ normal zt
+ normal M
+ aboveleft vert new
+ for i in range(1, totalLines)
+ call setline(i, 'line ' . i)
+ endfor
+ exe string(middle)
+ normal zt
+ normal M
+ " Execute the following two commands at once to reproduce the problem.
+ setl scb | wincmd p
+ setl scb
+ wincmd w
+ let topLineLeft = line('w0')
+ wincmd p
+ let topLineRight = line('w0')
+ setl noscrollbind
+ wincmd p
+ setl noscrollbind
+ call assert_equal(0, topLineLeft - topLineRight)
+endfunc