Skip to content

Commit 96d5c56

Browse files
brammooldouglasdrumond
authored andcommitted
patch 7.4.769 Problem: Behavior of :diffoff is not tested. Solution: Add a bit of testing. (Olaf Dabrunz)
1 parent 6ebbfe0 commit 96d5c56

File tree

3 files changed

+75
-2
lines changed

3 files changed

+75
-2
lines changed

src/testdir/test47.in

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Tests for vertical splits and filler lines in diff mode
22

3+
Also tests restoration of saved options by :diffoff.
4+
35
STARTTEST
46
:so small.vim
57
:" Disable the title to avoid xterm keeping the wrong one.
@@ -10,8 +12,15 @@ pkdd:w! Xtest
1012
ddGpkkrXoxxx:w! Xtest2
1113
:file Nop
1214
ggoyyyjjjozzzz
15+
:set foldmethod=marker foldcolumn=4
16+
:redir => nodiffsettings
17+
:silent! :set diff? fdm? fdc? scb? crb? wrap?
18+
:redir END
1319
:vert diffsplit Xtest
1420
:vert diffsplit Xtest2
21+
:redir => diffsettings
22+
:silent! :set diff? fdm? fdc? scb? crb? wrap?
23+
:redir END
1524
:" jump to second window for a moment to have filler line appear at start of
1625
:" first window
1726
ggpgg:let one = winline()
@@ -36,8 +45,30 @@ j:let three = three . "-" . winline()
3645
:call append("$", two)
3746
:call append("$", three)
3847
:$-2,$w! test.out
39-
:" Test that diffing shows correct filler lines
48+
:"
49+
:" Test diffoff
4050
:diffoff!
51+
:$put =nodiffsettings
52+
:$put =diffsettings
53+
1
54+
:redir => nd1
55+
:silent! :set diff? fdm? fdc? scb? crb? wrap?
56+
:redir END
57+

58+
:redir => nd2
59+
:silent! :set diff? fdm? fdc? scb? crb? wrap?
60+
:redir END
61+

62+
:redir => nd3
63+
:silent! :set diff? fdm? fdc? scb? crb? wrap?
64+
:redir END
65+

66+
:$put =nd1
67+
:$put =nd2
68+
:$put =nd3
69+
:$-39,$w >> test.out
70+
:"
71+
:" Test that diffing shows correct filler lines
4172
:windo :bw!
4273
:enew
4374
:put =range(4,10)
@@ -51,7 +82,7 @@ j:let three = three . "-" . winline()
5182
:enew
5283
:put =w0
5384
:.w >> test.out
54-
:unlet! one two three w0
85+
:unlet! one two three nodiffsettings diffsettings nd1 nd2 nd3 w0
5586
:qa!
5687
ENDTEST
5788

src/testdir/test47.ok

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,44 @@
11
2-4-5-6-8-9
22
1-2-4-5-8
33
2-3-4-5-6-7-8
4+
5+
6+
nodiff
7+
foldmethod=marker
8+
foldcolumn=4
9+
noscrollbind
10+
nocursorbind
11+
wrap
12+
13+
14+
diff
15+
foldmethod=diff
16+
foldcolumn=2
17+
scrollbind
18+
cursorbind
19+
nowrap
20+
21+
22+
nodiff
23+
foldmethod=marker
24+
foldcolumn=4
25+
noscrollbind
26+
nocursorbind
27+
wrap
28+
29+
30+
nodiff
31+
foldmethod=marker
32+
foldcolumn=4
33+
noscrollbind
34+
nocursorbind
35+
wrap
36+
37+
38+
nodiff
39+
foldmethod=marker
40+
foldcolumn=4
41+
noscrollbind
42+
nocursorbind
43+
wrap
444
1

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ static char *(features[]) =
756756

757757
static int included_patches[] =
758758
{ /* Add new patch number below this line */
759+
/**/
760+
769,
759761
/**/
760762
768,
761763
/**/

0 commit comments

Comments
 (0)