diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2015-03-11 00:33:02 -0400 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2015-03-11 00:33:02 -0400 |
| commit | 7c29aa10604162a4302c7b2686c1dcfcd5c206c8 (patch) | |
| tree | 793f1356cdffe95092af91723955638ec0816014 /test/functional/legacy/098_scrollbind_spec.lua | |
| parent | 51c6f38fcac82fb56965548631e913e8347dbe6a (diff) | |
| parent | c9fefe2a7432d3ac1c9397d65abe2fb7f6c557cc (diff) | |
| download | rneovim-7c29aa10604162a4302c7b2686c1dcfcd5c206c8.tar.gz rneovim-7c29aa10604162a4302c7b2686c1dcfcd5c206c8.tar.bz2 rneovim-7c29aa10604162a4302c7b2686c1dcfcd5c206c8.zip | |
Merge #2029 'migrate legacy tests'
Diffstat (limited to 'test/functional/legacy/098_scrollbind_spec.lua')
| -rw-r--r-- | test/functional/legacy/098_scrollbind_spec.lua | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/functional/legacy/098_scrollbind_spec.lua b/test/functional/legacy/098_scrollbind_spec.lua new file mode 100644 index 0000000000..7b2059e38b --- /dev/null +++ b/test/functional/legacy/098_scrollbind_spec.lua @@ -0,0 +1,48 @@ +-- Test for 'scrollbind' causing an unexpected scroll of one of the windows. + +local helpers = require('test.functional.helpers') +local feed, insert, source = helpers.feed, helpers.insert, helpers.source +local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect + +describe('scrollbind', function() + setup(clear) + + it('is working', function() + source([[ + set laststatus=0 + let g:totalLines = &lines * 20 + let middle = g:totalLines / 2 + wincmd n + wincmd o + for i in range(1, g:totalLines) + call setline(i, 'LINE ' . i) + endfor + exe string(middle) + normal zt + normal M + aboveleft vert new + for i in range(1, g:totalLines) + call setline(i, 'line ' . i) + endfor + exe string(middle) + normal zt + normal M + setl scb | wincmd p + setl scb + wincmd w + let topLineLeft = line('w0') + wincmd p + let topLineRight = line('w0') + setl noscrollbind + wincmd p + setl noscrollbind + q! + %del _ + call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight)) + brewind + ]]) + + -- Assert buffer contents. + expect("Difference between the top lines (left - right): 0") + end) +end) |