Mercurial > vim
annotate src/testdir/test_diffmode.vim @ 33738:2172872dfbcd v9.0.2096
patch 9.0.2096: Vim9: confusing usage of private
Commit: https://github.com/vim/vim/commit/03042a2753e3e6ac971045a8ce256d709214710e
Author: Ernie Rael <errael@raelity.com>
Date: Sat Nov 11 08:53:32 2023 +0100
patch 9.0.2096: Vim9: confusing usage of private
Problem: Vim9: confusing usage of private
Solution: clarify and use protected keyword instead
[vim9class] document `_` as protected instead of private
fixes #13504
closes: #13520
Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 11 Nov 2023 09:00:06 +0100 |
parents | b91aeab2d62e |
children | 3d0544e31ca5 |
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 |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21321
diff
changeset
|
2 |
14696
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 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
|
4 source screendump.vim |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17385
diff
changeset
|
5 source check.vim |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
6 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
7 func Test_diff_fold_sync() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
8 enew! |
14770
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
9 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
|
10 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
|
11 |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 let l = range(50) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 let winone = win_getid() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 new |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 let l[25] = 'diff' |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 let wintwo = win_getid() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 " line 15 is inside the closed fold |
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 call win_gotoid(winone) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 call assert_equal(19, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 " open the fold |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 normal zv |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
27 call assert_equal(-1, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
28 " 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
|
29 call win_gotoid(wintwo) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
30 call assert_equal(-1, foldclosedend(10)) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 " cursor position is in sync |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
33 normal 23G |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 call win_gotoid(winone) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 call assert_equal(23, getcurpos()[1]) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 |
29299
922b87383277
patch 8.2.5166: test for DiffUpdated fails
Bram Moolenaar <Bram@vim.org>
parents:
29295
diff
changeset
|
37 " depending on how redraw is done DiffUpdated may be triggered once or twice |
922b87383277
patch 8.2.5166: test for DiffUpdated fails
Bram Moolenaar <Bram@vim.org>
parents:
29295
diff
changeset
|
38 call assert_inrange(1, 2, g:update_count) |
14770
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
39 au! DiffUpdated |
27055ad9276b
patch 8.1.0397: no event triggered after updating diffs
Christian Brabandt <cb@256bit.org>
parents:
14762
diff
changeset
|
40 |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 windo diffoff |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 close! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 set nomodified |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 endfunc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
45 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
46 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
|
47 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
|
48 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
|
49 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
|
50 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
51 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
52 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
|
53 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
|
54 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
|
55 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
|
56 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
57 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
58 func Common_vert_split() |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
59 " 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
|
60 set notitle noicon |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
61 new |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
62 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
|
63 call setline(1, l) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
64 w! Xtest |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
65 normal dd |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
66 $ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
67 put |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
68 normal kkrXoxxx |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
69 w! Xtest2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
70 file Nop |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
71 normal ggoyyyjjjozzzz |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
72 set foldmethod=marker foldcolumn=4 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
73 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
74 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
75 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
76 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
77 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
78 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
79 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
80 vert diffsplit Xtest |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
81 vert diffsplit Xtest2 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
82 call assert_equal(1, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
83 call assert_equal('diff', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
84 call assert_equal(2, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
85 call assert_equal(1, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
86 call assert_equal(1, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
87 call assert_equal(0, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
88 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
89 let diff_fdm = &fdm |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
90 let diff_fdc = &fdc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
91 " 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
|
92 diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
93 " 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
|
94 " first window |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
95 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
96 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
97 wincmd p |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
98 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
99 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
100 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
101 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
102 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
103 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
104 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
105 call assert_equal(6, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
106 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
107 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
108 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
109 call assert_equal(9, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
110 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
111 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
112 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
113 call assert_equal(1, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
114 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
115 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
116 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
117 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
118 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
119 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
120 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
121 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
122 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
123 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
124 normal gg |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
125 call assert_equal(2, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
126 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
127 call assert_equal(3, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
128 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
129 call assert_equal(4, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
130 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
131 call assert_equal(5, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
132 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
133 call assert_equal(6, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
134 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
135 call assert_equal(7, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
136 normal j |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
137 call assert_equal(8, winline()) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
138 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
139 " Test diffoff |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
140 diffoff! |
29767
2e2f57f2875d
patch 9.0.0223: typo in diffmode test
Bram Moolenaar <Bram@vim.org>
parents:
29519
diff
changeset
|
141 1wincmd w |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
142 let &diff = 1 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
143 let &fdm = diff_fdm |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
144 let &fdc = diff_fdc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 4wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
146 diffoff! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
147 1wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
148 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
149 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
150 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
151 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
152 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
153 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
154 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
155 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
156 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
157 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
158 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
159 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
160 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
161 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
162 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
163 wincmd w |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 call assert_equal(0, &diff) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
165 call assert_equal('marker', &foldmethod) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
166 call assert_equal(4, &foldcolumn) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
167 call assert_equal(0, &scrollbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
168 call assert_equal(0, &cursorbind) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
169 call assert_equal(1, &wrap) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
170 |
9696
103e79a0ad8d
commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents:
9694
diff
changeset
|
171 call delete('Xtest') |
103e79a0ad8d
commit https://github.com/vim/vim/commit/623cf88f9c5ad49cce8e846af29a1bb9346c7481
Christian Brabandt <cb@256bit.org>
parents:
9694
diff
changeset
|
172 call delete('Xtest2') |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
173 windo bw! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
174 endfunc |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
175 |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
176 func Test_filler_lines() |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
177 " Test that diffing shows correct filler lines |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 enew! |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 put =range(4,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 vnew |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
182 put =range(1,10) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 1d _ |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
184 windo diffthis |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
185 wincmd h |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
186 call assert_equal(1, line('w0')) |
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
187 unlet! diff_fdm diff_fdc |
9701
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
188 windo diffoff |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
189 bwipe! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
190 enew! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
191 endfunc |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 |
9701
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
193 func Test_diffget_diffput() |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
194 enew! |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
195 let l = range(50) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
196 call setline(1, l) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
197 call assert_fails('diffget', 'E99:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
198 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
199 call assert_fails('diffget', 'E100:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
200 new |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
201 let l[10] = 'one' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
202 let l[20] = 'two' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
203 let l[30] = 'three' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
204 let l[40] = 'four' |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
205 call setline(1, l) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
206 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
207 call assert_equal('one', getline(11)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
208 11diffget |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
209 call assert_equal('10', getline(11)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
210 21diffput |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
211 wincmd w |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
212 call assert_equal('two', getline(21)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
213 normal 31Gdo |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
214 call assert_equal('three', getline(31)) |
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 normal 41Gdp |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
217 wincmd w |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
218 call assert_equal('40', getline(41)) |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
219 new |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
220 diffthis |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
221 call assert_fails('diffget', 'E101:') |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
222 |
172855211978
commit https://github.com/vim/vim/commit/90d121fa3637b423169c64528efe84a1e67060c9
Christian Brabandt <cb@256bit.org>
parents:
9696
diff
changeset
|
223 windo diffoff |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
224 %bwipe! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
225 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
226 |
14972
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
227 " Test putting two changes from one buffer to another |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
228 func Test_diffput_two() |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
229 new a |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
230 let win_a = win_getid() |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
231 call setline(1, range(1, 10)) |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
232 diffthis |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
233 new b |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
234 let win_b = win_getid() |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
235 call setline(1, range(1, 10)) |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
236 8del |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
237 5del |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
238 diffthis |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
239 call win_gotoid(win_a) |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
240 %diffput |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
241 call win_gotoid(win_b) |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
242 call assert_equal(map(range(1, 10), 'string(v:val)'), getline(1, '$')) |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
243 bwipe! a |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
244 bwipe! b |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
245 endfunc |
5d52b21b2e7f
patch 8.1.0497: :%diffput changes order of lines
Bram Moolenaar <Bram@vim.org>
parents:
14893
diff
changeset
|
246 |
24870
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
247 " Test for :diffget/:diffput with a range that is inside a diff chunk |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
248 func Test_diffget_diffput_range() |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
249 call setline(1, range(1, 10)) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
250 new |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
251 call setline(1, range(11, 20)) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
252 windo diffthis |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
253 3,5diffget |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
254 call assert_equal(['13', '14', '15'], getline(3, 5)) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
255 call setline(1, range(1, 10)) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
256 4,8diffput |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
257 wincmd p |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
258 call assert_equal(['13', '4', '5', '6', '7', '8', '19'], getline(3, 9)) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
259 %bw! |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
260 endfunc |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
261 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
262 " Test for :diffget/:diffput with an empty buffer and a non-empty buffer |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
263 func Test_diffget_diffput_empty_buffer() |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
264 %d _ |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
265 new |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
266 call setline(1, 'one') |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
267 windo diffthis |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
268 diffget |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
269 call assert_equal(['one'], getline(1, '$')) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
270 %d _ |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
271 diffput |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
272 wincmd p |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
273 call assert_equal([''], getline(1, '$')) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
274 %bw! |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
275 endfunc |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
276 |
19007
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
277 " :diffput and :diffget completes names of buffers which |
26211
485c7c4afeb7
patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents:
26044
diff
changeset
|
278 " are in diff mode and which are different than current buffer. |
19007
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
279 " No completion when the current window is not in diff mode. |
18987
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
280 func Test_diffget_diffput_completion() |
19007
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
281 e Xdiff1 | diffthis |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
282 botright new Xdiff2 |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
283 botright new Xdiff3 | split | diffthis |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
284 botright new Xdiff4 | diffthis |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
285 |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
286 wincmd t |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
287 call assert_equal('Xdiff1', bufname('%')) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
288 call feedkeys(":diffput \<C-A>\<C-B>\"\<CR>", 'tx') |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
289 call assert_equal('"diffput Xdiff3 Xdiff4', @:) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
290 call feedkeys(":diffget \<C-A>\<C-B>\"\<CR>", 'tx') |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
291 call assert_equal('"diffget Xdiff3 Xdiff4', @:) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
292 call assert_equal(['Xdiff3', 'Xdiff4'], getcompletion('', 'diff_buffer')) |
18987
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
293 |
19007
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
294 " Xdiff2 is not in diff mode, so no completion for :diffput, :diffget |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
295 wincmd j |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
296 call assert_equal('Xdiff2', bufname('%')) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
297 call feedkeys(":diffput \<C-A>\<C-B>\"\<CR>", 'tx') |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
298 call assert_equal('"diffput ', @:) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
299 call feedkeys(":diffget \<C-A>\<C-B>\"\<CR>", 'tx') |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
300 call assert_equal('"diffget ', @:) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
301 call assert_equal([], getcompletion('', 'diff_buffer')) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
302 |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
303 " Xdiff3 is split in 2 windows, only the top one is in diff mode. |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
304 " So completion of :diffput :diffget only happens in the top window. |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
305 wincmd j |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
306 call assert_equal('Xdiff3', bufname('%')) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
307 call assert_equal(1, &diff) |
18987
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
308 call feedkeys(":diffput \<C-A>\<C-B>\"\<CR>", 'tx') |
19007
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
309 call assert_equal('"diffput Xdiff1 Xdiff4', @:) |
18987
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
310 call feedkeys(":diffget \<C-A>\<C-B>\"\<CR>", 'tx') |
19007
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
311 call assert_equal('"diffget Xdiff1 Xdiff4', @:) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
312 call assert_equal(['Xdiff1', 'Xdiff4'], getcompletion('', 'diff_buffer')) |
18987
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
313 |
19007
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
314 wincmd j |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
315 call assert_equal('Xdiff3', bufname('%')) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
316 call assert_equal(0, &diff) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
317 call feedkeys(":diffput \<C-A>\<C-B>\"\<CR>", 'tx') |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
318 call assert_equal('"diffput ', @:) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
319 call feedkeys(":diffget \<C-A>\<C-B>\"\<CR>", 'tx') |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
320 call assert_equal('"diffget ', @:) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
321 call assert_equal([], getcompletion('', 'diff_buffer')) |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
322 |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
323 wincmd j |
0883a37ccf84
patch 8.2.0064: diffmode completion doesn't use per-window setting
Bram Moolenaar <Bram@vim.org>
parents:
18987
diff
changeset
|
324 call assert_equal('Xdiff4', bufname('%')) |
18987
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
325 call feedkeys(":diffput \<C-A>\<C-B>\"\<CR>", 'tx') |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
326 call assert_equal('"diffput Xdiff1 Xdiff3', @:) |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
327 call feedkeys(":diffget \<C-A>\<C-B>\"\<CR>", 'tx') |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
328 call assert_equal('"diffget Xdiff1 Xdiff3', @:) |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
329 call assert_equal(['Xdiff1', 'Xdiff3'], getcompletion('', 'diff_buffer')) |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
330 |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
331 %bwipe |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
332 endfunc |
e378907d79bf
patch 8.2.0054: :diffget and :diffput don't have good completion
Bram Moolenaar <Bram@vim.org>
parents:
18619
diff
changeset
|
333 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
334 func Test_dp_do_buffer() |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
335 e! one |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
336 let bn1=bufnr('%') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
337 let l = range(60) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
338 call setline(1, l) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
339 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
340 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
341 new two |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
342 let l[10] = 'one' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
343 let l[20] = 'two' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
344 let l[30] = 'three' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
345 let l[40] = 'four' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
346 let l[50] = 'five' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
347 call setline(1, l) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
348 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
349 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
350 " 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
|
351 11 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
352 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
|
353 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
|
354 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
|
355 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
|
356 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
357 " 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
|
358 call assert_equal('one', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
359 exe 'norm ' . bn1 . 'do' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
360 call assert_equal('10', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
361 21 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
362 call assert_equal('two', getline('.')) |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
363 diffget one |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
364 call assert_equal('20', getline('.')) |
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 31 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
367 exe 'norm ' . bn1 . 'dp' |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
368 41 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
369 diffput one |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
370 wincmd w |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
371 31 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
372 call assert_equal('three', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
373 41 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
374 call assert_equal('four', getline('.')) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
375 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
376 " 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
|
377 new not_in_diff_mode |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
378 let bn3=bufnr('%') |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
379 wincmd w |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
380 51 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
381 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
|
382 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
|
383 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
|
384 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
|
385 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
386 windo diffoff |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
387 %bwipe! |
9694
5e9f63a2ac5c
commit https://github.com/vim/vim/commit/42093c0ec52e6ff29e80aae65ac6a744c7de79bb
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
388 endfunc |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
389 |
14893
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
390 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
|
391 e! one |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
392 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
|
393 diffthis |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
394 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
395 new two |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
396 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
|
397 diffthis |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
398 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
399 1 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
400 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
|
401 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
|
402 wincmd w |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
403 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
|
404 norm G |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
405 norm do |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
406 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
|
407 |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
408 windo diffoff |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
409 %bwipe! |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
410 endfunc |
291656f731c9
patch 8.1.0458: ml_get error and crash when using "do"
Bram Moolenaar <Bram@vim.org>
parents:
14873
diff
changeset
|
411 |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
412 func Test_diffoff() |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
413 enew! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
414 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
|
415 redraw |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
416 let normattr = screenattr(1, 1) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
417 diffthis |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
418 botright vert new |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
419 call setline(1, ['One', '', 'Two', 'Three']) |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
420 diffthis |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
421 redraw |
17994
0dcc2ee838dd
patch 8.1.1993: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17837
diff
changeset
|
422 call assert_notequal(normattr, 1->screenattr(1)) |
10005
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
423 diffoff! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
424 redraw |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
425 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
|
426 bwipe! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
427 bwipe! |
4b4ba6589a98
commit https://github.com/vim/vim/commit/e67d546f3c691139e6d3d33f36724d98aec04c14
Christian Brabandt <cb@256bit.org>
parents:
9701
diff
changeset
|
428 endfunc |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
429 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
430 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
|
431 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
|
432 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
|
433 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
434 let normattr = screenattr(1, 1) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
435 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
436 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
437 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
|
438 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
|
439 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
440 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
441 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
442 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
|
443 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
|
444 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
|
445 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
|
446 |
12315
40ee9f3d265f
patch 8.0.1037: "icase" of 'diffopt' is not used for highlighting
Christian Brabandt <cb@256bit.org>
parents:
11430
diff
changeset
|
447 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
|
448 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
|
449 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
|
450 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
451 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
452 %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
|
453 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
454 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
455 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
|
456 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
|
457 call Common_icase_test() |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
458 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
459 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
460 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
461 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
|
462 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
|
463 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
|
464 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
|
465 endfunc |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
466 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
467 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
|
468 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
|
469 " 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
|
470 " 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
|
471 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
|
472 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
473 let normattr = screenattr(1, 1) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
474 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
475 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
476 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
|
477 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
|
478 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
479 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
480 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
481 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
|
482 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
|
483 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
|
484 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
|
485 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
|
486 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
|
487 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
488 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
489 %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
|
490 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
491 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
492 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
|
493 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
|
494 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
|
495 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
|
496 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
497 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
498 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
|
499 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
|
500 call Common_iwhite_test() |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
501 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
502 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
503 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
504 func Test_diffopt_context() |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
505 enew! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
506 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
|
507 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
508 new |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
509 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
|
510 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
511 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
512 set diffopt=context:2 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
513 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
|
514 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
|
515 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
|
516 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
517 set diffopt=context:1 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
518 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
|
519 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
|
520 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
|
521 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
522 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
523 %bwipe! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
524 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
525 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
526 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
527 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
|
528 set diffopt=internal,horizontal |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
529 diffsplit |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
530 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
531 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
|
532 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
|
533 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
|
534 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
|
535 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
536 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
537 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
538 %bwipe |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
539 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
540 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
541 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
|
542 set diffopt=internal,vertical |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
543 diffsplit |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
544 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
545 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
|
546 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
|
547 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
|
548 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
|
549 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
550 set diffopt& |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
551 diffoff! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
552 %bwipe |
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 |
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
|
555 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
|
556 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
|
557 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
|
558 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
|
559 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
|
560 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
|
561 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
|
562 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
|
563 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
|
564 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
|
565 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
|
566 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
|
567 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
|
568 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
|
569 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
|
570 " 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
|
571 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
|
572 |
ca3cb1997f08
patch 8.0.1361: some users don't want to diff with hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
12644
diff
changeset
|
573 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
|
574 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
|
575 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
|
576 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
|
577 |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
578 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
|
579 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
|
580 e! one |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
581 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
|
582 redraw |
10821
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
583 let normattr = screenattr(1, 1) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
584 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
585 botright vert new two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
586 call setline(1, ['One', 'Four']) |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
587 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
588 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
589 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
|
590 set hidden |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
591 close |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
592 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
593 " diffing with hidden buffer two |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
594 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
|
595 diffoff |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
596 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
597 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
|
598 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
599 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
600 " 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
|
601 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
|
602 diffoff! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
603 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
604 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
|
605 diffthis |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
606 redraw |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
607 " 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
|
608 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
|
609 |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
610 bwipe! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
611 bwipe! |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
612 set hidden& diffopt& |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
613 endfunc |
d9e48fb5142f
patch 8.0.0300: cannot stop diffing hidden buffers
Christian Brabandt <cb@256bit.org>
parents:
10295
diff
changeset
|
614 |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
615 func Test_setting_cursor() |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
616 new Xtest1 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
617 put =range(1,90) |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
618 wq |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
619 new Xtest2 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
620 put =range(1,100) |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
621 wq |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
622 |
10295
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
623 tabe Xtest2 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
624 $ |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
625 diffsp Xtest1 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
626 tabclose |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
627 |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
628 call delete('Xtest1') |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
629 call delete('Xtest2') |
d0b74b18e4b5
commit https://github.com/vim/vim/commit/025e3e0bafbc85cc4e365145af711edf99d0a90d
Christian Brabandt <cb@256bit.org>
parents:
10005
diff
changeset
|
630 endfunc |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
631 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
632 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
|
633 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
634 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
|
635 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
636 vnew |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
637 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
|
638 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
639 norm ]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
640 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
|
641 norm 3]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
642 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
|
643 norm 10]c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
644 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
|
645 norm [c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
646 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
|
647 norm 2[c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
648 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
|
649 norm 10[c |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
650 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
|
651 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
652 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
653 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
654 func Test_diffexpr() |
23027
f74978697fb6
patch 8.2.2060: check for features implemented with "if"
Bram Moolenaar <Bram@vim.org>
parents:
22818
diff
changeset
|
655 CheckExecutable diff |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
656 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
657 func DiffExpr() |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
658 " Prepend some text to check diff type detection |
14726
655f00c29c58
patch 8.1.0375: cannot use diff mode with Cygwin diff.exe
Christian Brabandt <cb@256bit.org>
parents:
14696
diff
changeset
|
659 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
|
660 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
|
661 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
662 set diffexpr=DiffExpr() |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
663 set diffopt=foldcolumn:0 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
664 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
665 enew! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
666 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
|
667 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
668 let normattr = screenattr(1, 1) |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
669 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
670 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
671 botright vert new |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
672 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
|
673 diffthis |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
674 |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
675 redraw |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
676 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
|
677 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
|
678 call assert_notequal(normattr, screenattr(3, 1)) |
24870
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
679 diffoff! |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
680 |
26211
485c7c4afeb7
patch 8.2.3637: typos in test files
Bram Moolenaar <Bram@vim.org>
parents:
26044
diff
changeset
|
681 " Try using a non-existing function for 'diffexpr'. |
24870
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
682 set diffexpr=NewDiffFunc() |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
683 call assert_fails('windo diffthis', ['E117:', 'E97:']) |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
684 diffoff! |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
685 |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
686 " Using a script-local function |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
687 func s:NewDiffExpr() |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
688 endfunc |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
689 set diffexpr=s:NewDiffExpr() |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
690 call assert_equal(expand('<SID>') .. 'NewDiffExpr()', &diffexpr) |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
691 set diffexpr=<SID>NewDiffExpr() |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
692 call assert_equal(expand('<SID>') .. 'NewDiffExpr()', &diffexpr) |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
693 |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
694 %bwipe! |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
695 set diffexpr& diffopt& |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
696 delfunc DiffExpr |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
697 delfunc s:NewDiffExpr |
11430
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
698 endfunc |
eba1a8c6e21d
patch 8.0.0599: diff mode is insufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
11113
diff
changeset
|
699 |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
700 func Test_diffpatch() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
701 " The patch program on MS-Windows may fail or hang. |
21765
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21321
diff
changeset
|
702 CheckExecutable patch |
08940efa6b4e
patch 8.2.1432: various inconsistencies in test files
Bram Moolenaar <Bram@vim.org>
parents:
21321
diff
changeset
|
703 CheckUnix |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
704 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
705 insert |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
706 *************** |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
707 *** 1,3 **** |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
708 1 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
709 ! 2 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
710 3 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
711 --- 1,4 ---- |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
712 1 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
713 ! 2x |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
714 3 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
715 + 4 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
716 . |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
717 saveas! Xpatch |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
718 bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
719 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
720 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
|
721 |
11113
081ed9efb5c0
patch 8.0.0444: diffpatch fails when the file name has a quote
Christian Brabandt <cb@256bit.org>
parents:
11109
diff
changeset
|
722 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
|
723 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
|
724 if name != 'Xpatch' |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
725 call rename('Xpatch', name) |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
726 endif |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
727 exe 'diffpatch ' . escape(name, '$') |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
728 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
|
729 if name != 'Xpatch' |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
730 call rename(name, 'Xpatch') |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
731 endif |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
732 bwipe! |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
733 endfor |
0adcfcf22036
patch 8.0.0442: patch shell command not well escaped
Christian Brabandt <cb@256bit.org>
parents:
11091
diff
changeset
|
734 |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
735 call delete('Xpatch') |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
736 bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
737 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
738 |
32218
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
739 " FIXME: test fails, the Xresult file can't be read |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
740 func No_Test_diffpatch_restricted() |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
741 let lines =<< trim END |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
742 call assert_fails('diffpatch NoSuchDiff', 'E145:') |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
743 |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
744 call writefile(v:errors, 'Xresult') |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
745 qa! |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
746 END |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
747 call writefile(lines, 'Xrestricted', 'D') |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
748 if RunVim([], [], '-Z --clean -S Xrestricted') |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
749 call assert_equal([], readfile('Xresult')) |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
750 endif |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
751 call delete('Xresult') |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
752 endfunc |
9c6bc59b6d80
patch 9.0.1440: "rvim" can execute a shell through :diffpatch
Bram Moolenaar <Bram@vim.org>
parents:
32208
diff
changeset
|
753 |
10984
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
754 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
|
755 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
|
756 exe "new Xtest" . i |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
757 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
758 endfor |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
759 new Xtest9 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
760 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
|
761 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
762 endfunc |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
763 |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
764 func Test_diff_nomodifiable() |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
765 new |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
766 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
|
767 setl nomodifiable |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
768 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
769 vnew |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
770 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
|
771 diffthis |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
772 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
|
773 setl nomodifiable |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
774 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
|
775 %bwipe! |
c0d5e8ab1452
patch 8.0.0381: diff mode is not sufficiently tested
Christian Brabandt <cb@256bit.org>
parents:
10821
diff
changeset
|
776 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
|
777 |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
778 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
|
779 new |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
780 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
|
781 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
782 vnew |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
783 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
|
784 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
785 redraw |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
786 |
17624
4c7097a980a5
patch 8.1.1809: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
787 call diff_hlID(-1, 1)->synIDattr("name")->assert_equal("") |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
788 |
17624
4c7097a980a5
patch 8.1.1809: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
789 call diff_hlID(1, 1)->synIDattr("name")->assert_equal("DiffChange") |
4c7097a980a5
patch 8.1.1809: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
790 call diff_hlID(1, 2)->synIDattr("name")->assert_equal("DiffText") |
4c7097a980a5
patch 8.1.1809: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
791 call diff_hlID(2, 1)->synIDattr("name")->assert_equal("") |
4c7097a980a5
patch 8.1.1809: more functions can be used as a method
Bram Moolenaar <Bram@vim.org>
parents:
17614
diff
changeset
|
792 call diff_hlID(3, 1)->synIDattr("name")->assert_equal("DiffAdd") |
17837
f71ee7b04f0b
patch 8.1.1915: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17624
diff
changeset
|
793 eval 4->diff_hlID(1)->synIDattr("name")->assert_equal("") |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
794 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
795 wincmd w |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
796 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
|
797 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
|
798 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
|
799 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
800 %bwipe! |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
801 endfunc |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
802 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
803 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
|
804 new |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
805 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
|
806 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
807 vnew |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
808 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
|
809 diffthis |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
810 redraw |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
811 |
17837
f71ee7b04f0b
patch 8.1.1915: more functions can be used as methods
Bram Moolenaar <Bram@vim.org>
parents:
17624
diff
changeset
|
812 call assert_equal([0, 0, 0, 0, 0, 0, 0, 1, 0], map(range(-1, 7), 'v:val->diff_filler()')) |
12549
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
813 wincmd w |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
814 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
|
815 |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
816 %bwipe! |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
817 endfunc |
62e8cef76508
patch 8.0.1153: no tests for diff_hlID() and diff_filler()
Christian Brabandt <cb@256bit.org>
parents:
12315
diff
changeset
|
818 |
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
|
819 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
|
820 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
|
821 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
|
822 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
|
823 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
|
824 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
|
825 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
|
826 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
|
827 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
|
828 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
|
829 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
|
830 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
|
831 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
|
832 $ |
f5bd684e47a1
patch 8.0.0421: diff mode wrong when adding line at end of buffer
Christian Brabandt <cb@256bit.org>
parents:
10984
diff
changeset
|
833 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
|
834 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
|
835 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
|
836 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
|
837 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
|
838 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
839 func WriteDiffFiles(buf, list1, list2) |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
840 call writefile(a:list1, 'Xdifile1') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
841 call writefile(a:list2, 'Xdifile2') |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
842 if a:buf |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
843 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
|
844 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
|
845 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
846 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
847 " 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
|
848 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
|
849 " 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
|
850 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
|
851 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
|
852 if VerifyScreenDump(a:buf, a:dumpfile, {}, cmd =~ 'internal' ? 'internal' : 'external') |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
853 " don't let the next iteration overwrite the "failed" file. |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
854 return |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
855 endif |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
856 endfor |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
857 |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
858 " also test unified diff |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
859 call term_sendkeys(a:buf, ":call SetupUnified()\<CR>:") |
24683
05c199ea8295
patch 8.2.2880: unified diff fails if actually used
Bram Moolenaar <Bram@vim.org>
parents:
24661
diff
changeset
|
860 call term_sendkeys(a:buf, ":redraw!\<CR>:") |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
861 call VerifyScreenDump(a:buf, a:dumpfile, {}, 'unified') |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
862 call term_sendkeys(a:buf, ":call StopUnified()\<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
|
863 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
864 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
865 " 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
|
866 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
|
867 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
|
868 " 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
|
869 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
|
870 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
|
871 endfunc |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
872 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
873 func Test_diff_screen() |
25969
a5a772dace5b
patch 8.2.3518: Test_xrestore sometimes fails
Bram Moolenaar <Bram@vim.org>
parents:
25717
diff
changeset
|
874 let g:test_is_flaky = 1 |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17385
diff
changeset
|
875 CheckScreendump |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17385
diff
changeset
|
876 CheckFeature menu |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17385
diff
changeset
|
877 |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
878 let lines =<< trim END |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
879 func UnifiedDiffExpr() |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
880 " Prepend some text to check diff type detection |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
881 call writefile(['warning', ' message'], v:fname_out) |
24683
05c199ea8295
patch 8.2.2880: unified diff fails if actually used
Bram Moolenaar <Bram@vim.org>
parents:
24661
diff
changeset
|
882 silent exe '!diff -U0 ' .. v:fname_in .. ' ' .. v:fname_new .. '>>' .. v:fname_out |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
883 endfunc |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
884 func SetupUnified() |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
885 set diffexpr=UnifiedDiffExpr() |
24683
05c199ea8295
patch 8.2.2880: unified diff fails if actually used
Bram Moolenaar <Bram@vim.org>
parents:
24661
diff
changeset
|
886 diffupdate |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
887 endfunc |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
888 func StopUnified() |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
889 set diffexpr= |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
890 endfunc |
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
891 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
892 call writefile(lines, 'XdiffSetup', 'D') |
24661
f51ea1b6d512
patch 8.2.2869: using unified diff is not tested
Bram Moolenaar <Bram@vim.org>
parents:
23895
diff
changeset
|
893 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
894 " clean up already existing swap files, just in case |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
895 call delete('.Xdifile1.swp') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
896 call delete('.Xdifile2.swp') |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
897 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
898 " 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
|
899 call WriteDiffFiles(0, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
900 let buf = RunVimInTerminal('-d -S XdiffSetup Xdifile1 Xdifile2', {}) |
16135
dc0801e374e0
patch 8.1.1072: extending sign and foldcolumn below the text is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15900
diff
changeset
|
901 " Set autoread mode, so that Vim won't complain once we re-write the test |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
902 " files |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
903 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
|
904 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
905 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
|
906 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
907 " 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
|
908 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
|
909 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
|
910 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
911 " 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
|
912 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
|
913 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
|
914 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
915 " 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
|
916 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
|
917 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
|
918 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
919 " 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
|
920 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
|
921 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
|
922 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
923 " 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
|
924 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
|
925 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
|
926 |
15900
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
927 " Variants on test 6 with different context settings |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
928 call term_sendkeys(buf, ":set diffopt+=context:2\<cr>") |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
929 call VerifyScreenDump(buf, 'Test_diff_06.2', {}) |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
930 call term_sendkeys(buf, ":set diffopt-=context:2\<cr>") |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
931 call term_sendkeys(buf, ":set diffopt+=context:1\<cr>") |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
932 call VerifyScreenDump(buf, 'Test_diff_06.1', {}) |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
933 call term_sendkeys(buf, ":set diffopt-=context:1\<cr>") |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
934 call term_sendkeys(buf, ":set diffopt+=context:0\<cr>") |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
935 call VerifyScreenDump(buf, 'Test_diff_06.0', {}) |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
936 call term_sendkeys(buf, ":set diffopt-=context:0\<cr>") |
360c93a884d0
patch 8.1.0956: using context:0 in 'diffopt' does not work well
Bram Moolenaar <Bram@vim.org>
parents:
15103
diff
changeset
|
937 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
938 " 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
|
939 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
|
940 \ ' 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
|
941 \ ' 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
|
942 \ ' 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
|
943 \ '{', ' 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
|
944 \ ['#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
|
945 \ ' 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
|
946 \ '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
|
947 \ ' 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
|
948 \ '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
|
949 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
|
950 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
|
951 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
|
952 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
953 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
|
954 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
|
955 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
956 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
|
957 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
|
958 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
959 " 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
|
960 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
|
961 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
|
962 \ ['', ' 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
|
963 \ ' 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
|
964 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
|
965 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
|
966 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
|
967 |
15103
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
968 " Leave trailing : at commandline! |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
969 call term_sendkeys(buf, ":set diffopt+=indent-heuristic\<cr>:\<cr>") |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
970 call VerifyScreenDump(buf, 'Test_diff_11', {}, 'one') |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
971 " shouldn't matter, if indent-algorithm comes before or after the algorithm |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
972 call term_sendkeys(buf, ":set diffopt&\<cr>") |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
973 call term_sendkeys(buf, ":set diffopt+=indent-heuristic,algorithm:patience\<cr>:\<cr>") |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
974 call VerifyScreenDump(buf, 'Test_diff_11', {}, 'two') |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
975 call term_sendkeys(buf, ":set diffopt&\<cr>") |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
976 call term_sendkeys(buf, ":set diffopt+=algorithm:patience,indent-heuristic\<cr>:\<cr>") |
9339601e7a31
patch 8.1.0562: parsing of 'diffopt' is slightly wrong
Bram Moolenaar <Bram@vim.org>
parents:
14984
diff
changeset
|
977 call VerifyScreenDump(buf, 'Test_diff_11', {}, 'three') |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
978 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
979 " 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
|
980 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
|
981 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
|
982 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
983 " 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
|
984 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
|
985 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
|
986 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
987 " 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
|
988 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
|
989 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
|
990 |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
991 " 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
|
992 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
|
993 \ ['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
|
994 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
|
995 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
|
996 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
|
997 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
|
998 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
|
999 |
14762
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
1000 " 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
|
1001 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
|
1002 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
|
1003 |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
1004 " 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
|
1005 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
|
1006 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
|
1007 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
|
1008 |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
1009 " 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
|
1010 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
|
1011 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
|
1012 |
b43ea03bb522
patch 8.1.0393: not all white space difference options available
Christian Brabandt <cb@256bit.org>
parents:
14726
diff
changeset
|
1013 " 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
|
1014 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
|
1015 |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
1016 " 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
|
1017 call StopVimInTerminal(buf) |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
1018 call delete('Xdifile1') |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
1019 call delete('Xdifile2') |
14696
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
1020 endfunc |
195e8b1fcbbf
patch 8.1.0360: using an external diff program is slow and inflexible
Christian Brabandt <cb@256bit.org>
parents:
12971
diff
changeset
|
1021 |
25717
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1022 func Test_diff_with_scroll_and_change() |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1023 CheckScreendump |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1024 |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1025 let lines =<< trim END |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1026 call setline(1, range(1, 15)) |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1027 vnew |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1028 call setline(1, range(9, 15)) |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1029 windo diffthis |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1030 wincmd h |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1031 exe "normal Gl5\<C-E>" |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1032 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1033 call writefile(lines, 'Xtest_scroll_change', 'D') |
25717
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1034 let buf = RunVimInTerminal('-S Xtest_scroll_change', {}) |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1035 |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1036 call VerifyScreenDump(buf, 'Test_diff_scroll_change_01', {}) |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1037 |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1038 call term_sendkeys(buf, "ax\<Esc>") |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1039 call VerifyScreenDump(buf, 'Test_diff_scroll_change_02', {}) |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1040 |
26044
2e8226c03007
patch 8.2.3556: filler lines are incorrect for other window in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25969
diff
changeset
|
1041 call term_sendkeys(buf, "\<C-W>lay\<Esc>") |
2e8226c03007
patch 8.2.3556: filler lines are incorrect for other window in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25969
diff
changeset
|
1042 call VerifyScreenDump(buf, 'Test_diff_scroll_change_03', {}) |
2e8226c03007
patch 8.2.3556: filler lines are incorrect for other window in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25969
diff
changeset
|
1043 |
25717
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1044 " clean up |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1045 call StopVimInTerminal(buf) |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1046 endfunc |
d3f992bc6ef8
patch 8.2.3394: filler lines are wrong when changing text in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
25517
diff
changeset
|
1047 |
14873
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1048 func Test_diff_with_cursorline() |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17385
diff
changeset
|
1049 CheckScreendump |
14873
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1050 |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1051 call writefile([ |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1052 \ '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
|
1053 \ 'set cursorline', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1054 \ '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
|
1055 \ 'vnew', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1056 \ '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
|
1057 \ 'windo diffthis', |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1058 \ '2wincmd w', |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1059 \ ], 'Xtest_diff_cursorline', 'D') |
14873
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1060 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
|
1061 |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1062 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
|
1063 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
|
1064 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
|
1065 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
|
1066 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
|
1067 |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1068 " clean up |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1069 call StopVimInTerminal(buf) |
a8ed1cb85859
patch 8.1.0448: cursorline not removed when using 'cursorbind'
Christian Brabandt <cb@256bit.org>
parents:
14770
diff
changeset
|
1070 endfunc |
14984
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1071 |
27990
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1072 func Test_diff_with_cursorline_number() |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1073 CheckScreendump |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1074 |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1075 let lines =<< trim END |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1076 hi CursorLine ctermbg=red ctermfg=white |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1077 hi CursorLineNr ctermbg=white ctermfg=black cterm=underline |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1078 set cursorline number |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1079 call setline(1, ["baz", "foo", "foo", "bar"]) |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1080 2 |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1081 vnew |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1082 call setline(1, ["foo", "foo", "bar"]) |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1083 windo diffthis |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1084 1wincmd w |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1085 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1086 call writefile(lines, 'Xtest_diff_cursorline_number', 'D') |
27990
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1087 let buf = RunVimInTerminal('-S Xtest_diff_cursorline_number', {}) |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1088 |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1089 call VerifyScreenDump(buf, 'Test_diff_with_cursorline_number_01', {}) |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1090 call term_sendkeys(buf, ":set cursorlineopt=number\r") |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1091 call VerifyScreenDump(buf, 'Test_diff_with_cursorline_number_02', {}) |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1092 |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1093 " clean up |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1094 call StopVimInTerminal(buf) |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1095 endfunc |
27ae8ea82d7a
patch 8.2.4520: using wrong highlight for cursor line number
Bram Moolenaar <Bram@vim.org>
parents:
27626
diff
changeset
|
1096 |
25517
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1097 func Test_diff_with_cursorline_breakindent() |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1098 CheckScreendump |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1099 |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1100 call writefile([ |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1101 \ 'hi CursorLine ctermbg=red ctermfg=white', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1102 \ 'set noequalalways wrap diffopt=followwrap cursorline breakindent', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1103 \ '50vnew', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1104 \ 'call setline(1, [" "," "," "," "])', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1105 \ 'exe "norm 20Afoo\<Esc>j20Afoo\<Esc>j20Afoo\<Esc>j20Abar\<Esc>"', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1106 \ 'vnew', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1107 \ 'call setline(1, [" "," "," "," "])', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1108 \ 'exe "norm 20Abee\<Esc>j20Afoo\<Esc>j20Afoo\<Esc>j20Abaz\<Esc>"', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1109 \ 'windo diffthis', |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1110 \ '2wincmd w', |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1111 \ ], 'Xtest_diff_cursorline_breakindent', 'D') |
25517
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1112 let buf = RunVimInTerminal('-S Xtest_diff_cursorline_breakindent', {}) |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1113 |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1114 call term_sendkeys(buf, "gg0") |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1115 call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_01', {}) |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1116 call term_sendkeys(buf, "j") |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1117 call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_02', {}) |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1118 call term_sendkeys(buf, "j") |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1119 call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_03', {}) |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1120 call term_sendkeys(buf, "j") |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1121 call VerifyScreenDump(buf, 'Test_diff_with_cul_bri_04', {}) |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1122 |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1123 " clean up |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1124 call StopVimInTerminal(buf) |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1125 endfunc |
b04e76e66128
patch 8.2.3295: 'cursorline' should not apply to 'breakindent'
Bram Moolenaar <Bram@vim.org>
parents:
24870
diff
changeset
|
1126 |
18092
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1127 func Test_diff_with_syntax() |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1128 CheckScreendump |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1129 |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1130 let lines =<< trim END |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
1131 void doNothing() { |
18092
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1132 int x = 0; |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1133 char *s = "hello"; |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1134 return 5; |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1135 } |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1136 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1137 call writefile(lines, 'Xprogram1.c', 'D') |
18092
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1138 let lines =<< trim END |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
1139 void doSomething() { |
18092
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1140 int x = 0; |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1141 char *s = "there"; |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1142 return 5; |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1143 } |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1144 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1145 call writefile(lines, 'Xprogram2.c', 'D') |
18092
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1146 |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1147 let lines =<< trim END |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
1148 edit Xprogram1.c |
18092
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1149 diffsplit Xprogram2.c |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1150 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1151 call writefile(lines, 'Xtest_diff_syntax', 'D') |
18092
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1152 let buf = RunVimInTerminal('-S Xtest_diff_syntax', {}) |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1153 |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1154 call VerifyScreenDump(buf, 'Test_diff_syntax_1', {}) |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1155 |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1156 " clean up |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1157 call StopVimInTerminal(buf) |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1158 endfunc |
995925603ea0
patch 8.1.2041: no test for diff mode with syntax highlighting
Bram Moolenaar <Bram@vim.org>
parents:
17994
diff
changeset
|
1159 |
14984
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1160 func Test_diff_of_diff() |
17614
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17385
diff
changeset
|
1161 CheckScreendump |
d7708560b77c
patch 8.1.1804: no test for display updating without a scroll region
Bram Moolenaar <Bram@vim.org>
parents:
17385
diff
changeset
|
1162 CheckFeature rightleft |
14984
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1163 |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1164 call writefile([ |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1165 \ 'call setline(1, ["aa","bb","cc","@@ -3,2 +5,7 @@","dd","ee","ff"])', |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1166 \ 'vnew', |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1167 \ 'call setline(1, ["aa","bb","cc"])', |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1168 \ 'windo diffthis', |
16135
dc0801e374e0
patch 8.1.1072: extending sign and foldcolumn below the text is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15900
diff
changeset
|
1169 \ '1wincmd w', |
dc0801e374e0
patch 8.1.1072: extending sign and foldcolumn below the text is confusing
Bram Moolenaar <Bram@vim.org>
parents:
15900
diff
changeset
|
1170 \ 'setlocal number', |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1171 \ ], 'Xtest_diff_diff', 'D') |
14984
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1172 let buf = RunVimInTerminal('-S Xtest_diff_diff', {}) |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1173 |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1174 call VerifyScreenDump(buf, 'Test_diff_of_diff_01', {}) |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1175 |
16137
5a2033905f19
patch 8.1.1073: space in number column is on wrong side with 'rightleft' set
Bram Moolenaar <Bram@vim.org>
parents:
16135
diff
changeset
|
1176 call term_sendkeys(buf, ":set rightleft\<cr>") |
5a2033905f19
patch 8.1.1073: space in number column is on wrong side with 'rightleft' set
Bram Moolenaar <Bram@vim.org>
parents:
16135
diff
changeset
|
1177 call VerifyScreenDump(buf, 'Test_diff_of_diff_02', {}) |
5a2033905f19
patch 8.1.1073: space in number column is on wrong side with 'rightleft' set
Bram Moolenaar <Bram@vim.org>
parents:
16135
diff
changeset
|
1178 |
14984
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1179 " clean up |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1180 call StopVimInTerminal(buf) |
28fde4aa8534
patch 8.1.0503: missing change to diff test
Bram Moolenaar <Bram@vim.org>
parents:
14972
diff
changeset
|
1181 endfunc |
18590
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1182 |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1183 func CloseoffSetup() |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1184 enew |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1185 call setline(1, ['one', 'two', 'three']) |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1186 diffthis |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1187 new |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1188 call setline(1, ['one', 'tow', 'three']) |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1189 diffthis |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1190 call assert_equal(1, &diff) |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1191 only! |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1192 endfunc |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1193 |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1194 func Test_diff_closeoff() |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1195 " "closeoff" included by default: last diff win gets 'diff' reset' |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1196 call CloseoffSetup() |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1197 call assert_equal(0, &diff) |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1198 enew! |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1199 |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1200 " "closeoff" excluded: last diff win keeps 'diff' set' |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1201 set diffopt-=closeoff |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1202 call CloseoffSetup() |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1203 call assert_equal(1, &diff) |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1204 diffoff! |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1205 enew! |
41484f342f80
patch 8.1.2289: after :diffsplit closing the window does not disable diff
Bram Moolenaar <Bram@vim.org>
parents:
18092
diff
changeset
|
1206 endfunc |
18619
788d76db02ac
patch 8.1.2302: :lockmarks does not work for '[ and ']
Bram Moolenaar <Bram@vim.org>
parents:
18590
diff
changeset
|
1207 |
23895
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1208 func Test_diff_followwrap() |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1209 new |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1210 set diffopt+=followwrap |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1211 set wrap |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1212 diffthis |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1213 call assert_equal(1, &wrap) |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1214 diffoff |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1215 set nowrap |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1216 diffthis |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1217 call assert_equal(0, &wrap) |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1218 diffoff |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1219 set diffopt& |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1220 bwipe! |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1221 endfunc |
e313b6ee2d9c
patch 8.2.2490: 'wrap' option is always reset when starting diff mode
Bram Moolenaar <Bram@vim.org>
parents:
23027
diff
changeset
|
1222 |
18619
788d76db02ac
patch 8.1.2302: :lockmarks does not work for '[ and ']
Bram Moolenaar <Bram@vim.org>
parents:
18590
diff
changeset
|
1223 func Test_diff_maintains_change_mark() |
26815
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1224 func DiffMaintainsChangeMark() |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1225 enew! |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1226 call setline(1, ['a', 'b', 'c', 'd']) |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1227 diffthis |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1228 new |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1229 call setline(1, ['a', 'b', 'c', 'e']) |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1230 " Set '[ and '] marks |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1231 2,3yank |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1232 call assert_equal([2, 3], [line("'["), line("']")]) |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1233 " Verify they aren't affected by the implicit diff |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1234 diffthis |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1235 call assert_equal([2, 3], [line("'["), line("']")]) |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1236 " Verify they aren't affected by an explicit diff |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1237 diffupdate |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1238 call assert_equal([2, 3], [line("'["), line("']")]) |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1239 bwipe! |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1240 bwipe! |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1241 endfunc |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1242 |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1243 set diffopt-=internal |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1244 call DiffMaintainsChangeMark() |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1245 set diffopt+=internal |
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1246 call DiffMaintainsChangeMark() |
27167
391eb1c30344
patch 8.2.4112: function not deleted at end of test
Bram Moolenaar <Bram@vim.org>
parents:
26815
diff
changeset
|
1247 |
26815
421d082c8f09
patch 8.2.3936: no proper test for maintaining change mark in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
26794
diff
changeset
|
1248 set diffopt& |
27167
391eb1c30344
patch 8.2.4112: function not deleted at end of test
Bram Moolenaar <Bram@vim.org>
parents:
26815
diff
changeset
|
1249 delfunc DiffMaintainsChangeMark |
18619
788d76db02ac
patch 8.1.2302: :lockmarks does not work for '[ and ']
Bram Moolenaar <Bram@vim.org>
parents:
18590
diff
changeset
|
1250 endfunc |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1251 |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1252 " Test for 'patchexpr' |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1253 func Test_patchexpr() |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1254 let g:patch_args = [] |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1255 func TPatch() |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1256 call add(g:patch_args, readfile(v:fname_in)) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1257 call add(g:patch_args, readfile(v:fname_diff)) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1258 call writefile(['output file'], v:fname_out) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1259 endfunc |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1260 set patchexpr=TPatch() |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1261 |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1262 call writefile(['input file'], 'Xinput', 'D') |
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1263 call writefile(['diff file'], 'Xdiff', 'D') |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1264 %bwipe! |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1265 edit Xinput |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1266 diffpatch Xdiff |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1267 call assert_equal('output file', getline(1)) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1268 call assert_equal('Xinput.new', bufname()) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1269 call assert_equal(2, winnr('$')) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1270 call assert_true(&diff) |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1271 |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1272 " Using a script-local function |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1273 func s:NewPatchExpr() |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1274 endfunc |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1275 set patchexpr=s:NewPatchExpr() |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1276 call assert_equal(expand('<SID>') .. 'NewPatchExpr()', &patchexpr) |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1277 set patchexpr=<SID>NewPatchExpr() |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1278 call assert_equal(expand('<SID>') .. 'NewPatchExpr()', &patchexpr) |
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1279 |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1280 set patchexpr& |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1281 delfunc TPatch |
26743
c2c40cefc17b
patch 8.2.3900: it is not easy to use a script-local function for an option
Bram Moolenaar <Bram@vim.org>
parents:
26211
diff
changeset
|
1282 delfunc s:NewPatchExpr |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1283 %bwipe! |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1284 endfunc |
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1285 |
20905
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1286 func Test_diff_rnu() |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1287 CheckScreendump |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1288 |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1289 let content =<< trim END |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1290 call setline(1, ['a', 'a', 'a', 'y', 'b', 'b', 'b', 'b', 'b']) |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1291 vnew |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1292 call setline(1, ['a', 'a', 'a', 'x', 'x', 'x', 'b', 'b', 'b', 'b', 'b']) |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1293 windo diffthis |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1294 setlocal number rnu foldcolumn=0 |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1295 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1296 call writefile(content, 'Xtest_diff_rnu', 'D') |
20905
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1297 let buf = RunVimInTerminal('-S Xtest_diff_rnu', {}) |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1298 |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1299 call VerifyScreenDump(buf, 'Test_diff_rnu_01', {}) |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1300 |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1301 call term_sendkeys(buf, "j") |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1302 call VerifyScreenDump(buf, 'Test_diff_rnu_02', {}) |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1303 call term_sendkeys(buf, "j") |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1304 call VerifyScreenDump(buf, 'Test_diff_rnu_03', {}) |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1305 |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1306 " clean up |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1307 call StopVimInTerminal(buf) |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1308 endfunc |
802bf80bcfe4
patch 8.2.1004: line numbers below filler lines not always updated
Bram Moolenaar <Bram@vim.org>
parents:
19954
diff
changeset
|
1309 |
21014
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1310 func Test_diff_multilineconceal() |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1311 new |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1312 diffthis |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1313 |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1314 new |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1315 call matchadd('Conceal', 'a\nb', 9, -1, {'conceal': 'Y'}) |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1316 set cole=2 cocu=n |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1317 call setline(1, ["a", "b"]) |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1318 diffthis |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1319 redraw |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1320 endfunc |
20133655107a
patch 8.2.1058: multiline conceal causes display errors
Bram Moolenaar <Bram@vim.org>
parents:
20905
diff
changeset
|
1321 |
21321
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1322 func Test_diff_and_scroll() |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1323 " this was causing an ml_get error |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1324 set ls=2 |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
1325 for i in range(winheight(0) * 2) |
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
1326 call setline(i, i < winheight(0) - 10 ? i : i + 10) |
21321
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1327 endfor |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1328 vnew |
31849
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
1329 for i in range(winheight(0)*2 + 10) |
dbec60b8c253
patch 9.0.1257: code style is not check in test scripts
Bram Moolenaar <Bram@vim.org>
parents:
30379
diff
changeset
|
1330 call setline(i, i < winheight(0) - 10 ? 0 : i) |
21321
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1331 endfor |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1332 diffthis |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1333 wincmd p |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1334 diffthis |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1335 execute 'normal ' . winheight(0) . "\<C-d>" |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1336 |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1337 bwipe! |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1338 bwipe! |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1339 set ls& |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1340 endfunc |
1421eca61db9
patch 8.2.1211: removed more than dead code
Bram Moolenaar <Bram@vim.org>
parents:
21014
diff
changeset
|
1341 |
22818
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1342 func Test_diff_filler_cursorcolumn() |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1343 CheckScreendump |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1344 |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1345 let content =<< trim END |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1346 call setline(1, ['aa', 'bb', 'cc']) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1347 vnew |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1348 call setline(1, ['aa', 'cc']) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1349 windo diffthis |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1350 wincmd p |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1351 setlocal cursorcolumn foldcolumn=0 |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1352 norm! gg0 |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1353 redraw! |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1354 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1355 call writefile(content, 'Xtest_diff_cuc', 'D') |
22818
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1356 let buf = RunVimInTerminal('-S Xtest_diff_cuc', {}) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1357 |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1358 call VerifyScreenDump(buf, 'Test_diff_cuc_01', {}) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1359 |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1360 call term_sendkeys(buf, "l") |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1361 call term_sendkeys(buf, "\<C-l>") |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1362 call VerifyScreenDump(buf, 'Test_diff_cuc_02', {}) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1363 call term_sendkeys(buf, "0j") |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1364 call term_sendkeys(buf, "\<C-l>") |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1365 call VerifyScreenDump(buf, 'Test_diff_cuc_03', {}) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1366 call term_sendkeys(buf, "l") |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1367 call term_sendkeys(buf, "\<C-l>") |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1368 call VerifyScreenDump(buf, 'Test_diff_cuc_04', {}) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1369 |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1370 " clean up |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1371 call StopVimInTerminal(buf) |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1372 endfunc |
b27601c0d289
patch 8.2.1957: diff and cursorcolumn highlighting don't mix
Bram Moolenaar <Bram@vim.org>
parents:
21765
diff
changeset
|
1373 |
24870
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1374 " Test for adding/removing lines inside diff chunks, between diff chunks |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1375 " and before diff chunks |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1376 func Test_diff_modify_chunks() |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1377 enew! |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1378 let w2_id = win_getid() |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1379 call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1380 new |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1381 let w1_id = win_getid() |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1382 call setline(1, ['a', '2', '3', 'd', 'e', 'f', '7', '8', 'i']) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1383 windo diffthis |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1384 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1385 " remove a line between two diff chunks and create a new diff chunk |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1386 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1387 5d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1388 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1389 call diff_hlID(5, 1)->synIDattr('name')->assert_equal('DiffAdd') |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1390 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1391 " add a line between two diff chunks |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1392 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1393 normal! 4Goe |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1394 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1395 call diff_hlID(4, 1)->synIDattr('name')->assert_equal('') |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1396 call diff_hlID(5, 1)->synIDattr('name')->assert_equal('') |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1397 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1398 " remove all the lines in a diff chunk. |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1399 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1400 7,8d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1401 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1402 let hl = range(1, 9)->map({_, lnum -> diff_hlID(lnum, 1)->synIDattr('name')}) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1403 call assert_equal(['', 'DiffText', 'DiffText', '', '', '', 'DiffAdd', |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1404 \ 'DiffAdd', ''], hl) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1405 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1406 " remove lines from one diff chunk to just before the next diff chunk |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1407 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1408 call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1409 2,6d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1410 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1411 let hl = range(1, 9)->map({_, lnum -> diff_hlID(lnum, 1)->synIDattr('name')}) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1412 call assert_equal(['', 'DiffText', 'DiffText', 'DiffAdd', 'DiffAdd', |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1413 \ 'DiffAdd', 'DiffAdd', 'DiffAdd', ''], hl) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1414 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1415 " remove lines just before the top of a diff chunk |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1416 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1417 call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1418 5,6d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1419 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1420 let hl = range(1, 9)->map({_, lnum -> diff_hlID(lnum, 1)->synIDattr('name')}) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1421 call assert_equal(['', 'DiffText', 'DiffText', '', 'DiffText', 'DiffText', |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1422 \ 'DiffAdd', 'DiffAdd', ''], hl) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1423 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1424 " remove line after the end of a diff chunk |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1425 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1426 call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1427 4d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1428 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1429 let hl = range(1, 9)->map({_, lnum -> diff_hlID(lnum, 1)->synIDattr('name')}) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1430 call assert_equal(['', 'DiffText', 'DiffText', 'DiffAdd', '', '', 'DiffText', |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1431 \ 'DiffText', ''], hl) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1432 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1433 " remove lines starting from the end of one diff chunk and ending inside |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1434 " another diff chunk |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1435 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1436 call setline(1, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i']) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1437 4,7d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1438 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1439 let hl = range(1, 9)->map({_, lnum -> diff_hlID(lnum, 1)->synIDattr('name')}) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1440 call assert_equal(['', 'DiffText', 'DiffText', 'DiffText', 'DiffAdd', |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1441 \ 'DiffAdd', 'DiffAdd', 'DiffAdd', ''], hl) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1442 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1443 " removing the only remaining diff chunk should make the files equal |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1444 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1445 call setline(1, ['a', '2', '3', 'x', 'd', 'e', 'f', 'x', '7', '8', 'i']) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1446 8d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1447 let hl = range(1, 10)->map({_, lnum -> diff_hlID(lnum, 1)->synIDattr('name')}) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1448 call assert_equal(['', '', '', 'DiffAdd', '', '', '', '', '', ''], hl) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1449 call win_gotoid(w2_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1450 4d |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1451 call win_gotoid(w1_id) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1452 let hl = range(1, 9)->map({_, lnum -> diff_hlID(lnum, 1)->synIDattr('name')}) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1453 call assert_equal(['', '', '', '', '', '', '', '', ''], hl) |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1454 |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1455 %bw! |
13812db714fa
patch 8.2.2973: fix for recovery and diff mode not tested
Bram Moolenaar <Bram@vim.org>
parents:
24683
diff
changeset
|
1456 endfunc |
24683
05c199ea8295
patch 8.2.2880: unified diff fails if actually used
Bram Moolenaar <Bram@vim.org>
parents:
24661
diff
changeset
|
1457 |
26794
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1458 func Test_diff_binary() |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1459 CheckScreendump |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1460 |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1461 let content =<< trim END |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1462 call setline(1, ['a', 'b', "c\n", 'd', 'e', 'f', 'g']) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1463 vnew |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1464 call setline(1, ['A', 'b', 'c', 'd', 'E', 'f', 'g']) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1465 windo diffthis |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1466 wincmd p |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1467 norm! gg0 |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1468 redraw! |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1469 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1470 call writefile(content, 'Xtest_diff_bin', 'D') |
26794
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1471 let buf = RunVimInTerminal('-S Xtest_diff_bin', {}) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1472 |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1473 " Test using internal diff |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1474 call VerifyScreenDump(buf, 'Test_diff_bin_01', {}) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1475 |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1476 " Test using internal diff and case folding |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1477 call term_sendkeys(buf, ":set diffopt+=icase\<cr>") |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1478 call term_sendkeys(buf, "\<C-l>") |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1479 call VerifyScreenDump(buf, 'Test_diff_bin_02', {}) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1480 " Test using external diff |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1481 call term_sendkeys(buf, ":set diffopt=filler\<cr>") |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1482 call term_sendkeys(buf, "\<C-l>") |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1483 call VerifyScreenDump(buf, 'Test_diff_bin_03', {}) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1484 " Test using external diff and case folding |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1485 call term_sendkeys(buf, ":set diffopt=filler,icase\<cr>") |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1486 call term_sendkeys(buf, "\<C-l>") |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1487 call VerifyScreenDump(buf, 'Test_diff_bin_04', {}) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1488 |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1489 " clean up |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1490 call StopVimInTerminal(buf) |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1491 set diffopt&vim |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1492 endfunc |
83a99f08d1e8
patch 8.2.3925: diff mode confused by NUL bytes
Bram Moolenaar <Bram@vim.org>
parents:
26743
diff
changeset
|
1493 |
27400
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1494 " Test for using the 'zi' command to invert 'foldenable' in diff windows (test |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1495 " for the issue fixed by patch 6.2.317) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1496 func Test_diff_foldinvert() |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1497 %bw! |
29997
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
1498 edit Xdoffile1 |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
1499 new Xdoffile2 |
98f5a0618a77
patch 9.0.0336: tests are flaky because of using a common file name
Bram Moolenaar <Bram@vim.org>
parents:
29767
diff
changeset
|
1500 new Xdoffile3 |
27400
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1501 windo diffthis |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1502 " open a non-diff window |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1503 botright new |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1504 1wincmd w |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1505 call assert_true(getwinvar(1, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1506 call assert_true(getwinvar(2, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1507 call assert_true(getwinvar(3, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1508 normal zi |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1509 call assert_false(getwinvar(1, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1510 call assert_false(getwinvar(2, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1511 call assert_false(getwinvar(3, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1512 normal zi |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1513 call assert_true(getwinvar(1, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1514 call assert_true(getwinvar(2, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1515 call assert_true(getwinvar(3, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1516 |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1517 " If the current window has 'noscrollbind', then 'zi' should not change |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1518 " 'foldenable' in other windows. |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1519 1wincmd w |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1520 set noscrollbind |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1521 normal zi |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1522 call assert_false(getwinvar(1, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1523 call assert_true(getwinvar(2, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1524 call assert_true(getwinvar(3, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1525 |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1526 " 'zi' should not change the 'foldenable' for windows with 'noscrollbind' |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1527 1wincmd w |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1528 set scrollbind |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1529 normal zi |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1530 call setwinvar(2, '&scrollbind', v:false) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1531 normal zi |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1532 call assert_false(getwinvar(1, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1533 call assert_true(getwinvar(2, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1534 call assert_false(getwinvar(3, '&foldenable')) |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1535 |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1536 %bw! |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1537 set scrollbind& |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1538 endfunc |
722db0819111
patch 8.2.4228: no tests for clicking in the GUI tabline
Bram Moolenaar <Bram@vim.org>
parents:
27167
diff
changeset
|
1539 |
29275
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1540 " This was scrolling for 'cursorbind' but 'scrollbind' is more important |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1541 func Test_diff_scroll() |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1542 CheckScreendump |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1543 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1544 let left =<< trim END |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1545 line 1 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1546 line 2 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1547 line 3 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1548 line 4 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1549 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1550 // Common block |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1551 // one |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1552 // containing |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1553 // four lines |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1554 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1555 // Common block |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1556 // two |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1557 // containing |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1558 // four lines |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1559 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1560 call writefile(left, 'Xleft', 'D') |
29275
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1561 let right =<< trim END |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1562 line 1 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1563 line 2 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1564 line 3 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1565 line 4 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1566 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1567 Lorem |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1568 ipsum |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1569 dolor |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1570 sit |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1571 amet, |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1572 consectetur |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1573 adipiscing |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1574 elit. |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1575 Etiam |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1576 luctus |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1577 lectus |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1578 sodales, |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1579 dictum |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1580 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1581 // Common block |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1582 // one |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1583 // containing |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1584 // four lines |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1585 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1586 Vestibulum |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1587 tincidunt |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1588 aliquet |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1589 nulla. |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1590 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1591 // Common block |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1592 // two |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1593 // containing |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1594 // four lines |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1595 END |
30379
25e3121ed316
patch 9.0.0525: manually deleting temp test files
Bram Moolenaar <Bram@vim.org>
parents:
29997
diff
changeset
|
1596 call writefile(right, 'Xright', 'D') |
29275
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1597 let buf = RunVimInTerminal('-d Xleft Xright', {'rows': 12}) |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1598 call term_sendkeys(buf, "\<C-W>\<C-W>jjjj") |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1599 call VerifyScreenDump(buf, 'Test_diff_scroll_1', {}) |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1600 call term_sendkeys(buf, "j") |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1601 call VerifyScreenDump(buf, 'Test_diff_scroll_2', {}) |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1602 |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1603 call StopVimInTerminal(buf) |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1604 endfunc |
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1605 |
32208
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1606 " This was scrolling too many lines. |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1607 func Test_diff_scroll_wrap_on() |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1608 20new |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1609 40vsplit |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1610 call setline(1, map(range(1, 9), 'repeat(v:val, 200)')) |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1611 setlocal number diff so=0 |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1612 redraw |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1613 normal! jj |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1614 call assert_equal(1, winsaveview().topline) |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1615 normal! j |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1616 call assert_equal(2, winsaveview().topline) |
33454
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1617 |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1618 bwipe! |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1619 bwipe! |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1620 endfunc |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1621 |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1622 func Test_diff_scroll_many_filler() |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1623 20new |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1624 vnew |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1625 call setline(1, ['^^^', '^^^', '$$$', '$$$']) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1626 diffthis |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1627 setlocal scrolloff=0 |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1628 wincmd p |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1629 call setline(1, ['^^^', '^^^'] + repeat(['###'], 41) + ['$$$', '$$$']) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1630 diffthis |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1631 setlocal scrolloff=0 |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1632 wincmd p |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1633 redraw |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1634 |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1635 " Note: need a redraw after each scroll, otherwise the test always passes. |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1636 normal! G |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1637 redraw |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1638 call assert_equal(3, winsaveview().topline) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1639 call assert_equal(18, winsaveview().topfill) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1640 exe "normal! \<C-B>" |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1641 redraw |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1642 call assert_equal(3, winsaveview().topline) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1643 call assert_equal(19, winsaveview().topfill) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1644 exe "normal! \<C-B>" |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1645 redraw |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1646 call assert_equal(2, winsaveview().topline) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1647 call assert_equal(0, winsaveview().topfill) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1648 exe "normal! \<C-B>" |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1649 redraw |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1650 call assert_equal(1, winsaveview().topline) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1651 call assert_equal(0, winsaveview().topfill) |
b91aeab2d62e
patch 9.0.1981: not being able to scroll up in diff mode
Christian Brabandt <cb@256bit.org>
parents:
32218
diff
changeset
|
1652 |
32208
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1653 bwipe! |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1654 bwipe! |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1655 endfunc |
73c5881c1793
patch 9.0.1435: scrolling too many lines when 'wrap' and 'diff' are set
Bram Moolenaar <Bram@vim.org>
parents:
31849
diff
changeset
|
1656 |
29293
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1657 " This was trying to update diffs for a buffer being closed |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1658 func Test_diff_only() |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1659 silent! lfile |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1660 set diff |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1661 lopen |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1662 norm o |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1663 silent! norm o |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1664 |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1665 set nodiff |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1666 %bwipe! |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1667 endfunc |
bf4d7898cf93
patch 8.2.5163: crash when deleting buffers in diff mode
Bram Moolenaar <Bram@vim.org>
parents:
29275
diff
changeset
|
1668 |
29295
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1669 " This was causing invalid diff block values |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1670 " FIXME: somehow this causes a valgrind error when run directly but not when |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1671 " run as a test. |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1672 func Test_diff_manipulations() |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1673 set diff |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1674 split 0 |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1675 sil! norm R doobdeuR doobdeuR doobdeu |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1676 |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1677 set nodiff |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1678 %bwipe! |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1679 endfunc |
92dd6fef5ace
patch 8.2.5164: invalid memory access after diff buffer manipulations
Bram Moolenaar <Bram@vim.org>
parents:
29293
diff
changeset
|
1680 |
29519
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1681 " This was causing the line number in the diff block to go below one. |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1682 " FIXME: somehow this causes a valgrind error when run directly but not when |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1683 " run as a test. |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1684 func Test_diff_put_and_undo() |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1685 set diff |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1686 next 0 |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1687 split 00 |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1688 sil! norm o0gguudpo0ggJuudp |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1689 |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1690 bwipe! |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1691 bwipe! |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1692 set nodiff |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1693 endfunc |
3afe997f4415
patch 9.0.0101: invalid memory access in diff mode with "dp" and undo
Bram Moolenaar <Bram@vim.org>
parents:
29299
diff
changeset
|
1694 |
29275
281509f1417b
patch 8.2.5155: in diff mode windows may get out of sync
Bram Moolenaar <Bram@vim.org>
parents:
27990
diff
changeset
|
1695 |
19689
da98d2ed8dc5
patch 8.2.0401: not enough test coverage for evalvars.c
Bram Moolenaar <Bram@vim.org>
parents:
19007
diff
changeset
|
1696 " vim: shiftwidth=2 sts=2 expandtab |