Mercurial > vim
annotate src/testdir/test_diffmode.vim @ 11359:0fc4e555506d
Added tag v8.0.0564 for changeset a6b9cdcde548e8c2344b8301a442591591b8e6eb
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 15 Apr 2017 14:45:06 +0200 |
parents | 081ed9efb5c0 |
children | eba1a8c6e21d |
rev | line source |
---|---|
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " Tests for diff mode |
11091
ae45d497868f
patch 8.0.0433: beeps when running tests
Christian Brabandt <cb@256bit.org>
parents:
11065
diff
changeset
|
2 set belloff=all |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 func Test_diff_fold_sync() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 enew! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 let l = range(50) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
9 let winone = win_getid() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 new |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 let l[25] = 'diff' |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 let wintwo = win_getid() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 " line 15 is inside the closed fold |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call assert_equal(19, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 call win_gotoid(winone) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call assert_equal(19, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 " open the fold |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 normal zv |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call assert_equal(-1, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " fold in other window must have opened too |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 call win_gotoid(wintwo) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call assert_equal(-1, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 " cursor position is in sync |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 normal 23G |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call win_gotoid(winone) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 call assert_equal(23, getcurpos()[1]) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 windo diffoff |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 close! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 set nomodified |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 endfunc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 func Test_vert_split() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 " Disable the title to avoid xterm keeping the wrong one. |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 set notitle noicon |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 new |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 let l = ['1 aa', '2 bb', '3 cc', '4 dd', '5 ee'] |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 w! Xtest |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 normal dd |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 $ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 put |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 normal kkrXoxxx |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
47 w! Xtest2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
48 file Nop |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
49 normal ggoyyyjjjozzzz |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
50 set foldmethod=marker foldcolumn=4 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
51 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
52 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
53 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
54 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
55 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
57 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 vert diffsplit Xtest |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 vert diffsplit Xtest2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
60 call assert_equal(1, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 call assert_equal('diff', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 call assert_equal(2, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 call assert_equal(1, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 call assert_equal(1, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 call assert_equal(0, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 let diff_fdm = &fdm |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 let diff_fdc = &fdc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 " repeat entering diff mode here to see if this saves the wrong settings |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 " jump to second window for a moment to have filler line appear at start of |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 " first window |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 wincmd p |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 call assert_equal(6, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 call assert_equal(9, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 call assert_equal(1, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 call assert_equal(3, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 call assert_equal(6, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 call assert_equal(7, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 " Test diffoff |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 diffoff! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 1wincmd 2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 let &diff = 1 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 let &fdm = diff_fdm |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 let &fdc = diff_fdc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 4wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 diffoff! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 1wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 |
9696
103e79a0ad8d
commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents:
9694
diff
changeset
|
149 call delete('Xtest') |
103e79a0ad8d
commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents:
9694
diff
changeset
|
150 call delete('Xtest2') |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 windo bw! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 endfunc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 func Test_filler_lines() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 " Test that diffing shows correct filler lines |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 enew! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 put =range(4,10) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 1d _ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 vnew |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 put =range(1,10) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 1d _ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 windo diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 wincmd h |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call assert_equal(1, line('w0')) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 unlet! diff_fdm diff_fdc |
9701
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
166 windo diffoff |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
167 bwipe! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
168 enew! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
169 endfunc |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 |
9701
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
171 func Test_diffget_diffput() |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
172 enew! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
173 let l = range(50) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
174 call setline(1, l) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
175 call assert_fails('diffget', 'E99:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
176 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
177 call assert_fails('diffget', 'E100:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
178 new |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
179 let l[10] = 'one' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
180 let l[20] = 'two' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
181 let l[30] = 'three' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
182 let l[40] = 'four' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
183 call setline(1, l) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
184 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
185 call assert_equal('one', getline(11)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
186 11diffget |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
187 call assert_equal('10', getline(11)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
188 21diffput |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
189 wincmd w |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
190 call assert_equal('two', getline(21)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
191 normal 31Gdo |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
192 call assert_equal('three', getline(31)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
193 call assert_equal('40', getline(41)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
194 normal 41Gdp |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
195 wincmd w |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
196 call assert_equal('40', getline(41)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
197 new |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
198 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
199 call assert_fails('diffget', 'E101:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
200 |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
201 windo diffoff |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
202 bwipe! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
203 bwipe! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
204 enew! |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 endfunc |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
206 |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
207 func Test_diffoff() |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
208 enew! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
209 call setline(1, ['Two', 'Three']) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
210 let normattr = screenattr(1, 1) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
211 diffthis |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
212 botright vert new |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
213 call setline(1, ['One', '', 'Two', 'Three']) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
214 diffthis |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
215 redraw |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
216 call assert_notequal(normattr, screenattr(1, 1)) |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
217 diffoff! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
218 redraw |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
219 call assert_equal(normattr, screenattr(1, 1)) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
220 bwipe! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
221 bwipe! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
222 endfunc |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
223 |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
224 func Test_diffoff_hidden() |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
225 set diffopt=filler,foldcolumn:0 |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
226 e! one |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
227 call setline(1, ['Two', 'Three']) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
228 let normattr = screenattr(1, 1) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
229 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
230 botright vert new two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
231 call setline(1, ['One', 'Four']) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
232 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
233 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
234 call assert_notequal(normattr, screenattr(1, 1)) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
235 set hidden |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
236 close |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
237 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
238 " diffing with hidden buffer two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
239 call assert_notequal(normattr, screenattr(1, 1)) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
240 diffoff |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
241 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
242 call assert_equal(normattr, screenattr(1, 1)) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
243 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
244 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
245 " still diffing with hidden buffer two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
246 call assert_notequal(normattr, screenattr(1, 1)) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
247 diffoff! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
248 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
249 call assert_equal(normattr, screenattr(1, 1)) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
250 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
251 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
252 " no longer diffing with hidden buffer two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
253 call assert_equal(normattr, screenattr(1, 1)) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
254 |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
255 bwipe! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
256 bwipe! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
257 set hidden& diffopt& |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
258 endfunc |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
259 |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
260 func Test_setting_cursor() |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
261 new Xtest1 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
262 put =range(1,90) |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
263 wq |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
264 new Xtest2 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
265 put =range(1,100) |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
266 wq |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
267 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
268 tabe Xtest2 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
269 $ |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
270 diffsp Xtest1 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
271 tabclose |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
272 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
273 call delete('Xtest1') |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
274 call delete('Xtest2') |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
275 endfunc |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
276 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
277 func Test_diff_move_to() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
278 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
279 call setline(1, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
280 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
281 vnew |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
282 call setline(1, [1, '2x', 3, 4, 4, 5, '6x', 7, '8x', 9, '10x']) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
283 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
284 norm ]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
285 call assert_equal(2, line('.')) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
286 norm 3]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
287 call assert_equal(9, line('.')) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
288 norm 10]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
289 call assert_equal(11, line('.')) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
290 norm [c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
291 call assert_equal(9, line('.')) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
292 norm 2[c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
293 call assert_equal(5, line('.')) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
294 norm 10[c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
295 call assert_equal(2, line('.')) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
296 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
297 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
298 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
299 func Test_diffpatch() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
300 " The patch program on MS-Windows may fail or hang. |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
301 if !executable('patch') || !has('unix') |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
302 return |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
303 endif |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
304 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
305 insert |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
306 *************** |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
307 *** 1,3 **** |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
308 1 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
309 ! 2 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
310 3 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
311 --- 1,4 ---- |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
312 1 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
313 ! 2x |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
314 3 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
315 + 4 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
316 . |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
317 saveas Xpatch |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
318 bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
319 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
320 call assert_fails('diffpatch Xpatch', 'E816:') |
11109
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
321 |
11113
081ed9efb5c0
patch 8.0.0444: diffpatch fails when the file name has a quote
Christian Brabandt <cb@256bit.org>
parents:
11109
diff
changeset
|
322 for name in ['Xpatch', 'Xpatch$HOME', 'Xpa''tch'] |
11109
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
323 call setline(1, ['1', '2', '3']) |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
324 if name != 'Xpatch' |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
325 call rename('Xpatch', name) |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
326 endif |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
327 exe 'diffpatch ' . escape(name, '$') |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
328 call assert_equal(['1', '2x', '3', '4'], getline(1, '$')) |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
329 if name != 'Xpatch' |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
330 call rename(name, 'Xpatch') |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
331 endif |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
332 bwipe! |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
333 endfor |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
334 |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
335 call delete('Xpatch') |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
336 bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
337 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
338 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
339 func Test_diff_too_many_buffers() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
340 for i in range(1, 8) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
341 exe "new Xtest" . i |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
342 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
343 endfor |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
344 new Xtest9 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
345 call assert_fails('diffthis', 'E96:') |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
346 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
347 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
348 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
349 func Test_diff_nomodifiable() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
350 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
351 call setline(1, [1, 2, 3, 4]) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
352 setl nomodifiable |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
353 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
354 vnew |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
355 call setline(1, ['1x', 2, 3, 3, 4]) |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
356 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
357 call assert_fails('norm dp', 'E793:') |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
358 setl nomodifiable |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
359 call assert_fails('norm do', 'E21:') |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
360 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
361 endfunc |
11065
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
362 |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
363 func Test_diff_lastline() |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
364 enew! |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
365 only! |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
366 call setline(1, ['This is a ', 'line with five ', 'rows']) |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
367 diffthis |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
368 botright vert new |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
369 call setline(1, ['This is', 'a line with ', 'four rows']) |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
370 diffthis |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
371 1 |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
372 call feedkeys("Je a\<CR>", 'tx') |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
373 call feedkeys("Je a\<CR>", 'tx') |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
374 let w1lines = winline() |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
375 wincmd w |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
376 $ |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
377 let w2lines = winline() |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
378 call assert_equal(w2lines, w1lines) |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
379 bwipe! |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
380 bwipe! |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
381 endfunc |