Mercurial > vim
annotate src/testdir/test_scrollbind.vim @ 13592:a64485061f75 v8.0.1668
patch 8.0.1668: terminal debugger: can't re-open source code window
commit https://github.com/vim/vim/commit/c4b533e1e93151658cb170c6796d327a8c0f8612
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 6 22:26:25 2018 +0200
patch 8.0.1668: terminal debugger: can't re-open source code window
Problem: Terminal debugger: can't re-open source code window.
Solution: Add the :Source command. Also create the window if needed when
gdb stops at a source line.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 06 Apr 2018 22:30:07 +0200 |
parents | 0240e7e3d736 |
children | 687ab2b5252b |
rev | line source |
---|---|
11961
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Test for 'scrollbind' causing an unexpected scroll of one of the windows. |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 func Test_scrollbind() |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " We don't want the status line to cause problems: |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 set laststatus=0 |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 let totalLines = &lines * 20 |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 let middle = totalLines / 2 |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 new | only |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 for i in range(1, totalLines) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 call setline(i, 'LINE ' . i) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 endfor |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 exe string(middle) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 normal zt |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 normal M |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 aboveleft vert new |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 for i in range(1, totalLines) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call setline(i, 'line ' . i) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 endfor |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 exe string(middle) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 normal zt |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 normal M |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 " Execute the following two commands at once to reproduce the problem. |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 setl scb | wincmd p |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 setl scb |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 wincmd w |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 let topLineLeft = line('w0') |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 wincmd p |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 let topLineRight = line('w0') |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 setl noscrollbind |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 wincmd p |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 setl noscrollbind |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 call assert_equal(0, topLineLeft - topLineRight) |
0240e7e3d736
patch 8.0.0861: still many old style tests
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 endfunc |