Mercurial > vim
annotate src/testdir/test_diffmode.vim @ 14951:6adb462db592
Added tag v8.1.0486 for changeset 6783403ff35e1849f998ab56324f59a9cc155782
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 19 Oct 2018 17:45:07 +0200 |
parents | 291656f731c9 |
children | 5d52b21b2e7f |
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 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
2 source shared.vim |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
3 source screendump.vim |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
5 func Test_diff_fold_sync() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 enew! |
14770
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
7 let g:update_count = 0 |
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
8 au DiffUpdated * let g:update_count += 1 |
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
9 |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 let l = range(50) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 let winone = win_getid() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 new |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 let l[25] = 'diff' |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 let wintwo = win_getid() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 " line 15 is inside the closed fold |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 call assert_equal(19, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 call win_gotoid(winone) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 call assert_equal(19, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 " open the fold |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 normal zv |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 call assert_equal(-1, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 " 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
|
27 call win_gotoid(wintwo) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 call assert_equal(-1, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
29 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 " cursor position is in sync |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 normal 23G |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 call win_gotoid(winone) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 call assert_equal(23, getcurpos()[1]) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
14770
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
35 call assert_equal(1, g:update_count) |
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
36 au! DiffUpdated |
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
37 |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 windo diffoff |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 close! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 set nomodified |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 endfunc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 func Test_vert_split() |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
44 set diffopt=filler |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
45 call Common_vert_split() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
46 set diffopt& |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
47 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
48 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
49 func Test_vert_split_internal() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
50 set diffopt=internal,filler |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
51 call Common_vert_split() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
52 set diffopt& |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
53 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
54 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
55 func Common_vert_split() |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
56 " 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
|
57 set notitle noicon |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
58 new |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 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
|
60 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 w! Xtest |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 normal dd |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
63 $ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 put |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 normal kkrXoxxx |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 w! Xtest2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 file Nop |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 normal ggoyyyjjjozzzz |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 set foldmethod=marker foldcolumn=4 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 vert diffsplit Xtest |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 vert diffsplit Xtest2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 call assert_equal(1, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 call assert_equal('diff', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 call assert_equal(2, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 call assert_equal(1, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 call assert_equal(1, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 call assert_equal(0, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 let diff_fdm = &fdm |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 let diff_fdc = &fdc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 " 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
|
89 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 " 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
|
91 " first window |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
92 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
94 wincmd p |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 call assert_equal(6, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 call assert_equal(9, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 call assert_equal(1, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 call assert_equal(3, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 call assert_equal(6, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 call assert_equal(7, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 " Test diffoff |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 diffoff! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 1wincmd 2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 let &diff = 1 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 let &fdm = diff_fdm |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
141 let &fdc = diff_fdc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 4wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 diffoff! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 1wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 |
9696
103e79a0ad8d
commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents:
9694
diff
changeset
|
168 call delete('Xtest') |
103e79a0ad8d
commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents:
9694
diff
changeset
|
169 call delete('Xtest2') |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 windo bw! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
171 endfunc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
172 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 func Test_filler_lines() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 " Test that diffing shows correct filler lines |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 enew! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 put =range(4,10) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 1d _ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 vnew |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 put =range(1,10) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
180 1d _ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 windo diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 wincmd h |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 call assert_equal(1, line('w0')) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 unlet! diff_fdm diff_fdc |
9701
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
185 windo diffoff |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
186 bwipe! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
187 enew! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
188 endfunc |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
189 |
9701
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
190 func Test_diffget_diffput() |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
191 enew! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
192 let l = range(50) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
193 call setline(1, l) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
194 call assert_fails('diffget', 'E99:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
195 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
196 call assert_fails('diffget', 'E100:') |
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 let l[10] = 'one' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
199 let l[20] = 'two' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
200 let l[30] = 'three' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
201 let l[40] = 'four' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
202 call setline(1, l) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
203 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
204 call assert_equal('one', getline(11)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
205 11diffget |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
206 call assert_equal('10', getline(11)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
207 21diffput |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
208 wincmd w |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
209 call assert_equal('two', getline(21)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
210 normal 31Gdo |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
211 call assert_equal('three', getline(31)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
212 call assert_equal('40', getline(41)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
213 normal 41Gdp |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
214 wincmd w |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
215 call assert_equal('40', getline(41)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
216 new |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
217 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
218 call assert_fails('diffget', 'E101:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
219 |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
220 windo diffoff |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
221 %bwipe! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
222 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
223 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
224 func Test_dp_do_buffer() |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
225 e! one |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
226 let bn1=bufnr('%') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
227 let l = range(60) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
228 call setline(1, l) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
229 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
230 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
231 new two |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
232 let l[10] = 'one' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
233 let l[20] = 'two' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
234 let l[30] = 'three' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
235 let l[40] = 'four' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
236 let l[50] = 'five' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
237 call setline(1, l) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
238 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
239 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
240 " dp and do with invalid buffer number. |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
241 11 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
242 call assert_fails('norm 99999dp', 'E102:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
243 call assert_fails('norm 99999do', 'E102:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
244 call assert_fails('diffput non_existing_buffer', 'E94:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
245 call assert_fails('diffget non_existing_buffer', 'E94:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
246 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
247 " dp and do with valid buffer number. |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
248 call assert_equal('one', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
249 exe 'norm ' . bn1 . 'do' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
250 call assert_equal('10', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
251 21 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
252 call assert_equal('two', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
253 diffget one |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
254 call assert_equal('20', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
255 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
256 31 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
257 exe 'norm ' . bn1 . 'dp' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
258 41 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
259 diffput one |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
260 wincmd w |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
261 31 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
262 call assert_equal('three', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
263 41 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
264 call assert_equal('four', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
265 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
266 " dp and do with buffer number which is not in diff mode. |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
267 new not_in_diff_mode |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
268 let bn3=bufnr('%') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
269 wincmd w |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
270 51 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
271 call assert_fails('exe "norm" . bn3 . "dp"', 'E103:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
272 call assert_fails('exe "norm" . bn3 . "do"', 'E103:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
273 call assert_fails('diffput not_in_diff_mode', 'E94:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
274 call assert_fails('diffget not_in_diff_mode', 'E94:') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
275 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
276 windo diffoff |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
277 %bwipe! |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
278 endfunc |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
279 |
14893
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
280 func Test_do_lastline() |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
281 e! one |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
282 call setline(1, ['1','2','3','4','5','6']) |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
283 diffthis |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
284 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
285 new two |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
286 call setline(1, ['2','4','5']) |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
287 diffthis |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
288 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
289 1 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
290 norm dp]c |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
291 norm dp]c |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
292 wincmd w |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
293 call assert_equal(4, line('$')) |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
294 norm G |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
295 norm do |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
296 call assert_equal(3, line('$')) |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
297 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
298 windo diffoff |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
299 %bwipe! |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
300 endfunc |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
301 |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
302 func Test_diffoff() |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
303 enew! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
304 call setline(1, ['Two', 'Three']) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
305 redraw |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
306 let normattr = screenattr(1, 1) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
307 diffthis |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
308 botright vert new |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
309 call setline(1, ['One', '', 'Two', 'Three']) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
310 diffthis |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
311 redraw |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
312 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
|
313 diffoff! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
314 redraw |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
315 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
|
316 bwipe! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
317 bwipe! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
318 endfunc |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
319 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
320 func Common_icase_test() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
321 edit one |
12315
40ee9f3d265f
patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents:
11430
diff
changeset
|
322 call setline(1, ['One', 'Two', 'Three', 'Four', 'Fi#ve']) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
323 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
324 let normattr = screenattr(1, 1) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
325 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
326 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
327 botright vert new two |
12315
40ee9f3d265f
patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents:
11430
diff
changeset
|
328 call setline(1, ['one', 'TWO', 'Three ', 'Four', 'fI=VE']) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
329 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
330 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
331 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
332 call assert_equal(normattr, screenattr(1, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
333 call assert_equal(normattr, screenattr(2, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
334 call assert_notequal(normattr, screenattr(3, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
335 call assert_equal(normattr, screenattr(4, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
336 |
12315
40ee9f3d265f
patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents:
11430
diff
changeset
|
337 let dtextattr = screenattr(5, 3) |
40ee9f3d265f
patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents:
11430
diff
changeset
|
338 call assert_notequal(dtextattr, screenattr(5, 1)) |
40ee9f3d265f
patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents:
11430
diff
changeset
|
339 call assert_notequal(dtextattr, screenattr(5, 5)) |
40ee9f3d265f
patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents:
11430
diff
changeset
|
340 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
341 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
342 %bwipe! |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
343 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
344 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
345 func Test_diffopt_icase() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
346 set diffopt=icase,foldcolumn:0 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
347 call Common_icase_test() |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
348 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
349 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
350 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
351 func Test_diffopt_icase_internal() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
352 set diffopt=icase,foldcolumn:0,internal |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
353 call Common_icase_test() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
354 set diffopt& |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
355 endfunc |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
356 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
357 func Common_iwhite_test() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
358 edit one |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
359 " Difference in trailing spaces and amount of spaces should be ignored, |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
360 " but not other space differences. |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
361 call setline(1, ["One \t", 'Two', 'Three', 'one two', 'one two', 'Four']) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
362 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
363 let normattr = screenattr(1, 1) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
364 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
365 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
366 botright vert new two |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
367 call setline(1, ["One\t ", "Two\t ", 'Three', 'one two', 'onetwo', ' Four']) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
368 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
369 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
370 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
371 call assert_equal(normattr, screenattr(1, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
372 call assert_equal(normattr, screenattr(2, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
373 call assert_equal(normattr, screenattr(3, 1)) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
374 call assert_equal(normattr, screenattr(4, 1)) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
375 call assert_notequal(normattr, screenattr(5, 1)) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
376 call assert_notequal(normattr, screenattr(6, 1)) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
377 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
378 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
379 %bwipe! |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
380 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
381 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
382 func Test_diffopt_iwhite() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
383 set diffopt=iwhite,foldcolumn:0 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
384 call Common_iwhite_test() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
385 set diffopt& |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
386 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
387 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
388 func Test_diffopt_iwhite_internal() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
389 set diffopt=internal,iwhite,foldcolumn:0 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
390 call Common_iwhite_test() |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
391 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
392 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
393 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
394 func Test_diffopt_context() |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
395 enew! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
396 call setline(1, ['1', '2', '3', '4', '5', '6', '7']) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
397 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
398 new |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
399 call setline(1, ['1', '2', '3', '4', '5x', '6', '7']) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
400 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
401 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
402 set diffopt=context:2 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
403 call assert_equal('+-- 2 lines: 1', foldtextresult(1)) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
404 set diffopt=internal,context:2 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
405 call assert_equal('+-- 2 lines: 1', foldtextresult(1)) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
406 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
407 set diffopt=context:1 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
408 call assert_equal('+-- 3 lines: 1', foldtextresult(1)) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
409 set diffopt=internal,context:1 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
410 call assert_equal('+-- 3 lines: 1', foldtextresult(1)) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
411 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
412 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
413 %bwipe! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
414 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
415 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
416 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
417 func Test_diffopt_horizontal() |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
418 set diffopt=internal,horizontal |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
419 diffsplit |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
420 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
421 call assert_equal(&columns, winwidth(1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
422 call assert_equal(&columns, winwidth(2)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
423 call assert_equal(&lines, winheight(1) + winheight(2) + 3) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
424 call assert_inrange(0, 1, winheight(1) - winheight(2)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
425 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
426 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
427 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
428 %bwipe |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
429 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
430 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
431 func Test_diffopt_vertical() |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
432 set diffopt=internal,vertical |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
433 diffsplit |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
434 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
435 call assert_equal(&lines - 2, winheight(1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
436 call assert_equal(&lines - 2, winheight(2)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
437 call assert_equal(&columns, winwidth(1) + winwidth(2) + 1) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
438 call assert_inrange(0, 1, winwidth(1) - winwidth(2)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
439 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
440 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
441 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
442 %bwipe |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
443 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
444 |
12971
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
445 func Test_diffopt_hiddenoff() |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
446 set diffopt=internal,filler,foldcolumn:0,hiddenoff |
12971
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
447 e! one |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
448 call setline(1, ['Two', 'Three']) |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
449 redraw |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
450 let normattr = screenattr(1, 1) |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
451 diffthis |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
452 botright vert new two |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
453 call setline(1, ['One', 'Four']) |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
454 diffthis |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
455 redraw |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
456 call assert_notequal(normattr, screenattr(1, 1)) |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
457 set hidden |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
458 close |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
459 redraw |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
460 " should not diffing with hidden buffer two while 'hiddenoff' is enabled |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
461 call assert_equal(normattr, screenattr(1, 1)) |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
462 |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
463 bwipe! |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
464 bwipe! |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
465 set hidden& diffopt& |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
466 endfunc |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
467 |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
468 func Test_diffoff_hidden() |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
469 set diffopt=internal,filler,foldcolumn:0 |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
470 e! one |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
471 call setline(1, ['Two', 'Three']) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
472 redraw |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
473 let normattr = screenattr(1, 1) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
474 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
475 botright vert new two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
476 call setline(1, ['One', 'Four']) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
477 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
478 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
479 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
|
480 set hidden |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
481 close |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
482 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
483 " diffing with hidden buffer two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
484 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
|
485 diffoff |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
486 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
487 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
|
488 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
489 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
490 " 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
|
491 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
|
492 diffoff! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
493 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
494 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
|
495 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
496 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
497 " 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
|
498 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
|
499 |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
500 bwipe! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
501 bwipe! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
502 set hidden& diffopt& |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
503 endfunc |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
504 |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
505 func Test_setting_cursor() |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
506 new Xtest1 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
507 put =range(1,90) |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
508 wq |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
509 new Xtest2 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
510 put =range(1,100) |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
511 wq |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
512 |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
513 tabe Xtest2 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
514 $ |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
515 diffsp Xtest1 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
516 tabclose |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
517 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
518 call delete('Xtest1') |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
519 call delete('Xtest2') |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
520 endfunc |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
521 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
522 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
|
523 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
524 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
|
525 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
526 vnew |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
527 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
|
528 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
529 norm ]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
530 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
|
531 norm 3]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
532 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
|
533 norm 10]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
534 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
|
535 norm [c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
536 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
|
537 norm 2[c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
538 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
|
539 norm 10[c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
540 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
|
541 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
542 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
543 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
544 func Test_diffexpr() |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
545 if !executable('diff') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
546 return |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
547 endif |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
548 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
549 func DiffExpr() |
14726
655f00c29c58
patch 8.1.0375: cannot use diff mode with Cygwin diff.exe
Christian Brabandt <cb@256bit.org>
parents:
14696
diff
changeset
|
550 " Prepent some text to check diff type detection |
655f00c29c58
patch 8.1.0375: cannot use diff mode with Cygwin diff.exe
Christian Brabandt <cb@256bit.org>
parents:
14696
diff
changeset
|
551 call writefile(['warning', ' message'], v:fname_out) |
655f00c29c58
patch 8.1.0375: cannot use diff mode with Cygwin diff.exe
Christian Brabandt <cb@256bit.org>
parents:
14696
diff
changeset
|
552 silent exe '!diff ' . v:fname_in . ' ' . v:fname_new . '>>' . v:fname_out |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
553 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
554 set diffexpr=DiffExpr() |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
555 set diffopt=foldcolumn:0 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
556 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
557 enew! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
558 call setline(1, ['one', 'two', 'three']) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
559 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
560 let normattr = screenattr(1, 1) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
561 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
562 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
563 botright vert new |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
564 call setline(1, ['one', 'two', 'three.']) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
565 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
566 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
567 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
568 call assert_equal(normattr, screenattr(1, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
569 call assert_equal(normattr, screenattr(2, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
570 call assert_notequal(normattr, screenattr(3, 1)) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
571 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
572 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
573 %bwipe! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
574 set diffexpr& diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
575 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
576 |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
577 func Test_diffpatch() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
578 " 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
|
579 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
|
580 return |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
581 endif |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
582 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
583 insert |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
584 *************** |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
585 *** 1,3 **** |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
586 1 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
587 ! 2 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
588 3 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
589 --- 1,4 ---- |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
590 1 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
591 ! 2x |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
592 3 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
593 + 4 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
594 . |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
595 saveas! Xpatch |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
596 bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
597 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
598 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
|
599 |
11113
081ed9efb5c0
patch 8.0.0444: diffpatch fails when the file name has a quote
Christian Brabandt <cb@256bit.org>
parents:
11109
diff
changeset
|
600 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
|
601 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
|
602 if name != 'Xpatch' |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
603 call rename('Xpatch', name) |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
604 endif |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
605 exe 'diffpatch ' . escape(name, '$') |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
606 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
|
607 if name != 'Xpatch' |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
608 call rename(name, 'Xpatch') |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
609 endif |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
610 bwipe! |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
611 endfor |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
612 |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
613 call delete('Xpatch') |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
614 bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
615 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
616 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
617 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
|
618 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
|
619 exe "new Xtest" . i |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
620 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
621 endfor |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
622 new Xtest9 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
623 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
|
624 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
625 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
626 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
627 func Test_diff_nomodifiable() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
628 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
629 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
|
630 setl nomodifiable |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
631 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
632 vnew |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
633 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
|
634 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
635 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
|
636 setl nomodifiable |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
637 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
|
638 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
639 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
|
640 |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
641 func Test_diff_hlID() |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
642 new |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
643 call setline(1, [1, 2, 3]) |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
644 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
645 vnew |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
646 call setline(1, ['1x', 2, 'x', 3]) |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
647 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
648 redraw |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
649 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
650 call assert_equal(synIDattr(diff_hlID(-1, 1), "name"), "") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
651 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
652 call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
653 call assert_equal(synIDattr(diff_hlID(1, 2), "name"), "DiffText") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
654 call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
655 call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "DiffAdd") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
656 call assert_equal(synIDattr(diff_hlID(4, 1), "name"), "") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
657 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
658 wincmd w |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
659 call assert_equal(synIDattr(diff_hlID(1, 1), "name"), "DiffChange") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
660 call assert_equal(synIDattr(diff_hlID(2, 1), "name"), "") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
661 call assert_equal(synIDattr(diff_hlID(3, 1), "name"), "") |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
662 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
663 %bwipe! |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
664 endfunc |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
665 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
666 func Test_diff_filler() |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
667 new |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
668 call setline(1, [1, 2, 3, 'x', 4]) |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
669 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
670 vnew |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
671 call setline(1, [1, 2, 'y', 'y', 3, 4]) |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
672 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
673 redraw |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
674 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
675 call assert_equal([0, 0, 0, 0, 0, 0, 0, 1, 0], map(range(-1, 7), 'diff_filler(v:val)')) |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
676 wincmd w |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
677 call assert_equal([0, 0, 0, 0, 2, 0, 0, 0], map(range(-1, 6), 'diff_filler(v:val)')) |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
678 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
679 %bwipe! |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
680 endfunc |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
681 |
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
|
682 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
|
683 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
|
684 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
|
685 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
|
686 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
|
687 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
|
688 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
|
689 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
|
690 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
|
691 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
|
692 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
|
693 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
|
694 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
|
695 $ |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
696 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
|
697 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
|
698 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
|
699 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
|
700 endfunc |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
701 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
702 func WriteDiffFiles(buf, list1, list2) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
703 call writefile(a:list1, 'Xfile1') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
704 call writefile(a:list2, 'Xfile2') |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
705 if a:buf |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
706 call term_sendkeys(a:buf, ":checktime\<CR>") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
707 endif |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
708 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
709 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
710 " Verify a screendump with both the internal and external diff. |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
711 func VerifyBoth(buf, dumpfile, extra) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
712 " trailing : for leaving the cursor on the command line |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
713 for cmd in [":set diffopt=filler" . a:extra . "\<CR>:", ":set diffopt+=internal\<CR>:"] |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
714 call term_sendkeys(a:buf, cmd) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
715 if VerifyScreenDump(a:buf, a:dumpfile, {}, cmd =~ 'internal' ? 'internal' : 'external') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
716 break " don't let the next iteration overwrite the "failed" file. |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
717 endif |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
718 endfor |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
719 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
720 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
721 " Verify a screendump with the internal diff only. |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
722 func VerifyInternal(buf, dumpfile, extra) |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
723 call term_sendkeys(a:buf, ":diffupdate!\<CR>") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
724 " trailing : for leaving the cursor on the command line |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
725 call term_sendkeys(a:buf, ":set diffopt=internal,filler" . a:extra . "\<CR>:") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
726 call VerifyScreenDump(a:buf, a:dumpfile, {}) |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
727 endfunc |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
728 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
729 func Test_diff_screen() |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
730 if !CanRunVimInTerminal() || !has('menu') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
731 return |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
732 endif |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
733 " clean up already existing swap files, just in case |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
734 call delete('.Xfile1.swp') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
735 call delete('.Xfile2.swp') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
736 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
737 " Test 1: Add a line in beginning of file 2 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
738 call WriteDiffFiles(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
739 let buf = RunVimInTerminal('-d Xfile1 Xfile2', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
740 " Set autoread mode, ,so that Vim won't complain once we re-write the test |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
741 " files |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
742 call term_sendkeys(buf, ":set autoread\<CR>\<c-w>w:set autoread\<CR>\<c-w>w") |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
743 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
744 call VerifyBoth(buf, 'Test_diff_01', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
745 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
746 " Test 2: Add a line in beginning of file 1 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
747 call WriteDiffFiles(buf, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
748 call VerifyBoth(buf, 'Test_diff_02', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
749 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
750 " Test 3: Add a line at the end of file 2 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
751 call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
752 call VerifyBoth(buf, 'Test_diff_03', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
753 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
754 " Test 4: Add a line at the end of file 1 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
755 call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
756 call VerifyBoth(buf, 'Test_diff_04', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
757 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
758 " Test 5: Add a line in the middle of file 2, remove on at the end of file 1 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
759 call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10]) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
760 call VerifyBoth(buf, 'Test_diff_05', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
761 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
762 " Test 6: Add a line in the middle of file 1, remove on at the end of file 2 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
763 call WriteDiffFiles(buf, [1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
764 call VerifyBoth(buf, 'Test_diff_06', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
765 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
766 " Test 7 - 9: Test normal/patience/histogram diff algorithm |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
767 call WriteDiffFiles(buf, ['#include <stdio.h>', '', '// Frobs foo heartily', 'int frobnitz(int foo)', '{', |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
768 \ ' int i;', ' for(i = 0; i < 10; i++)', ' {', ' printf("Your answer is: ");', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
769 \ ' printf("%d\n", foo);', ' }', '}', '', 'int fact(int n)', '{', ' if(n > 1)', ' {', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
770 \ ' return fact(n-1) * n;', ' }', ' return 1;', '}', '', 'int main(int argc, char **argv)', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
771 \ '{', ' frobnitz(fact(10));', '}'], |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
772 \ ['#include <stdio.h>', '', 'int fib(int n)', '{', ' if(n > 2)', ' {', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
773 \ ' return fib(n-1) + fib(n-2);', ' }', ' return 1;', '}', '', '// Frobs foo heartily', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
774 \ 'int frobnitz(int foo)', '{', ' int i;', ' for(i = 0; i < 10; i++)', ' {', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
775 \ ' printf("%d\n", foo);', ' }', '}', '', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
776 \ 'int main(int argc, char **argv)', '{', ' frobnitz(fib(10));', '}']) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
777 call term_sendkeys(buf, ":diffupdate!\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
778 call term_sendkeys(buf, ":set diffopt+=internal\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
779 call VerifyScreenDump(buf, 'Test_diff_07', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
780 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
781 call term_sendkeys(buf, ":set diffopt+=algorithm:patience\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
782 call VerifyScreenDump(buf, 'Test_diff_08', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
783 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
784 call term_sendkeys(buf, ":set diffopt+=algorithm:histogram\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
785 call VerifyScreenDump(buf, 'Test_diff_09', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
786 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
787 " Test 10-11: normal/indent-heuristic |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
788 call term_sendkeys(buf, ":set diffopt&vim\<cr>") |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
789 call WriteDiffFiles(buf, ['', ' def finalize(values)', '', ' values.each do |v|', ' v.finalize', ' end'], |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
790 \ ['', ' def finalize(values)', '', ' values.each do |v|', ' v.prepare', ' end', '', |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
791 \ ' values.each do |v|', ' v.finalize', ' end']) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
792 call term_sendkeys(buf, ":diffupdate!\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
793 call term_sendkeys(buf, ":set diffopt+=internal\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
794 call VerifyScreenDump(buf, 'Test_diff_10', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
795 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
796 call term_sendkeys(buf, ":set diffopt+=indent-heuristic\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
797 call VerifyScreenDump(buf, 'Test_diff_11', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
798 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
799 " Test 12: diff the same file |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
800 call WriteDiffFiles(buf, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
801 call VerifyBoth(buf, 'Test_diff_12', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
802 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
803 " Test 13: diff an empty file |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
804 call WriteDiffFiles(buf, [], []) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
805 call VerifyBoth(buf, 'Test_diff_13', '') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
806 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
807 " Test 14: test diffopt+=icase |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
808 call WriteDiffFiles(buf, ['a', 'b', 'cd'], ['A', 'b', 'cDe']) |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
809 call VerifyBoth(buf, 'Test_diff_14', " diffopt+=filler diffopt+=icase") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
810 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
811 " Test 15-16: test diffopt+=iwhite |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
812 call WriteDiffFiles(buf, ['int main()', '{', ' printf("Hello, World!");', ' return 0;', '}'], |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
813 \ ['int main()', '{', ' if (0)', ' {', ' printf("Hello, World!");', ' return 0;', ' }', '}']) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
814 call term_sendkeys(buf, ":diffupdate!\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
815 call term_sendkeys(buf, ":set diffopt&vim diffopt+=filler diffopt+=iwhite\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
816 call VerifyScreenDump(buf, 'Test_diff_15', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
817 call term_sendkeys(buf, ":set diffopt+=internal\<cr>") |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
818 call VerifyScreenDump(buf, 'Test_diff_16', {}) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
819 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
820 " Test 17: test diffopt+=iblank |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
821 call WriteDiffFiles(buf, ['a', ' ', 'cd', 'ef', 'xxx'], ['a', 'cd', '', 'ef', 'yyy']) |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
822 call VerifyInternal(buf, 'Test_diff_17', " diffopt+=iblank") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
823 |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
824 " Test 18: test diffopt+=iblank,iwhite / iwhiteall / iwhiteeol |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
825 call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhite") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
826 call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteall") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
827 call VerifyInternal(buf, 'Test_diff_18', " diffopt+=iblank,iwhiteeol") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
828 |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
829 " Test 19: test diffopt+=iwhiteeol |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
830 call WriteDiffFiles(buf, ['a ', 'x', 'cd', 'ef', 'xx xx', 'foo', 'bar'], ['a', 'x', 'c d', ' ef', 'xx xx', 'foo', '', 'bar']) |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
831 call VerifyInternal(buf, 'Test_diff_19', " diffopt+=iwhiteeol") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
832 |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
833 " Test 19: test diffopt+=iwhiteall |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
834 call VerifyInternal(buf, 'Test_diff_20', " diffopt+=iwhiteall") |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
835 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
836 " clean up |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
837 call StopVimInTerminal(buf) |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
838 call delete('Xfile1') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
839 call delete('Xfile2') |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
840 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
841 |
14873
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
842 func Test_diff_with_cursorline() |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
843 if !CanRunVimInTerminal() |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
844 return |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
845 endif |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
846 |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
847 call writefile([ |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
848 \ 'hi CursorLine ctermbg=red ctermfg=white', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
849 \ 'set cursorline', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
850 \ 'call setline(1, ["foo","foo","foo","bar"])', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
851 \ 'vnew', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
852 \ 'call setline(1, ["bee","foo","foo","baz"])', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
853 \ 'windo diffthis', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
854 \ '2wincmd w', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
855 \ ], 'Xtest_diff_cursorline') |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
856 let buf = RunVimInTerminal('-S Xtest_diff_cursorline', {}) |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
857 |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
858 call VerifyScreenDump(buf, 'Test_diff_with_cursorline_01', {}) |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
859 call term_sendkeys(buf, "j") |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
860 call VerifyScreenDump(buf, 'Test_diff_with_cursorline_02', {}) |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
861 call term_sendkeys(buf, "j") |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
862 call VerifyScreenDump(buf, 'Test_diff_with_cursorline_03', {}) |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
863 |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
864 " clean up |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
865 call StopVimInTerminal(buf) |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
866 call delete('Xtest_diff_cursorline') |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
867 endfunc |