blob: 83ccba09e9a6faab432e675e5e3070b0844f62b4 [file] [log] [blame]
Bram Moolenaar04c5c9e2013-07-09 13:44:59 +02001Test for 'scrollbind' causing an unexpected scroll of one of the windows.
2STARTTEST
3:so small.vim
Bram Moolenaarb7a846d2013-07-17 21:40:31 +02004:" We don't want the status line to cause problems:
5:set laststatus=0
6:let g:totalLines = &lines * 20
7:let middle = g:totalLines / 2
8:wincmd n
9:wincmd o
10:for i in range(1, g:totalLines)
11: call setline(i, 'LINE ' . i)
12:endfor
13:exe string(middle)
14:normal zt
15:normal M
16:aboveleft vert new
17:for i in range(1, g:totalLines)
18: call setline(i, 'line ' . i)
19:endfor
20:exe string(middle)
21:normal zt
22:normal M
23:" Execute the following two command at once to reproduce the problem.
24:setl scb | wincmd p
25:setl scb
26:wincmd w
Bram Moolenaar04c5c9e2013-07-09 13:44:59 +020027:let topLineLeft = line('w0')
28:wincmd p
29:let topLineRight = line('w0')
30:setl noscrollbind
31:wincmd p
32:setl noscrollbind
33:q!
34:%del _
35:call setline(1, 'Difference between the top lines (left - right): ' . string(topLineLeft - topLineRight))
36:w! test.out
37:brewind
38ENDTEST
39
40STARTTEST
41:qa!
42ENDTEST
43