Bram Moolenaar | 04c5c9e | 2013-07-09 13:44:59 +0200 | [diff] [blame] | 1 | Test for 'scrollbind' causing an unexpected scroll of one of the windows. |
| 2 | STARTTEST |
| 3 | :so small.vim |
Bram Moolenaar | b7a846d | 2013-07-17 21:40:31 +0200 | [diff] [blame^] | 4 | :" 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 Moolenaar | 04c5c9e | 2013-07-09 13:44:59 +0200 | [diff] [blame] | 27 | :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 |
| 38 | ENDTEST |
| 39 | |
| 40 | STARTTEST |
| 41 | :qa! |
| 42 | ENDTEST |
| 43 | |