blob: f15eaf0f8f366287962f8469289a4ecf83271e5f [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001Tests for vertical splits and filler lines in diff mode
2
Bram Moolenaar2693ca22015-07-04 15:05:14 +02003Also tests restoration of saved options by :diffoff.
4
Bram Moolenaar071d4272004-06-13 20:20:40 +00005STARTTEST
6:so small.vim
Bram Moolenaarbed7bec2010-07-25 13:42:29 +02007:" Disable the title to avoid xterm keeping the wrong one.
8:set notitle noicon
Bram Moolenaar071d4272004-06-13 20:20:40 +00009/^1
10yG:new
11pkdd:w! Xtest
12ddGpkkrXoxxx:w! Xtest2
13:file Nop
14ggoyyyjjjozzzz
Bram Moolenaar2693ca22015-07-04 15:05:14 +020015:set foldmethod=marker foldcolumn=4
16:redir => nodiffsettings
17:silent! :set diff? fdm? fdc? scb? crb? wrap?
18:redir END
Bram Moolenaar071d4272004-06-13 20:20:40 +000019:vert diffsplit Xtest
20:vert diffsplit Xtest2
Bram Moolenaar2693ca22015-07-04 15:05:14 +020021:redir => diffsettings
22:silent! :set diff? fdm? fdc? scb? crb? wrap?
23:redir END
Bram Moolenaar27823602015-07-28 14:42:45 +020024:let diff_fdm = &fdm
25:let diff_fdc = &fdc
26:" repeat entering diff mode here to see if this saves the wrong settings
27:diffthis
Bram Moolenaar071d4272004-06-13 20:20:40 +000028:" jump to second window for a moment to have filler line appear at start of
29:" first window
30ggpgg:let one = winline()
31j:let one = one . "-" . winline()
32j:let one = one . "-" . winline()
33j:let one = one . "-" . winline()
34j:let one = one . "-" . winline()
35j:let one = one . "-" . winline()
36gg:let two = winline()
37j:let two = two . "-" . winline()
38j:let two = two . "-" . winline()
39j:let two = two . "-" . winline()
40j:let two = two . "-" . winline()
41gg:let three = winline()
42j:let three = three . "-" . winline()
43j:let three = three . "-" . winline()
44j:let three = three . "-" . winline()
45j:let three = three . "-" . winline()
46j:let three = three . "-" . winline()
47j:let three = three . "-" . winline()
48:call append("$", one)
49:call append("$", two)
50:call append("$", three)
51:$-2,$w! test.out
Bram Moolenaar2693ca22015-07-04 15:05:14 +020052:"
53:" Test diffoff
Bram Moolenaara80888d2012-10-21 22:18:21 +020054:diffoff!
Bram Moolenaar27823602015-07-28 14:42:45 +0200551
56:let &diff = 1
57:let &fdm = diff_fdm
58:let &fdc = diff_fdc
594
60:diffoff!
Bram Moolenaar2693ca22015-07-04 15:05:14 +020061:$put =nodiffsettings
62:$put =diffsettings
631
64:redir => nd1
65:silent! :set diff? fdm? fdc? scb? crb? wrap?
66:redir END
67
68:redir => nd2
69:silent! :set diff? fdm? fdc? scb? crb? wrap?
70:redir END
71
72:redir => nd3
73:silent! :set diff? fdm? fdc? scb? crb? wrap?
74:redir END
75
76:$put =nd1
77:$put =nd2
78:$put =nd3
79:$-39,$w >> test.out
80:"
81:" Test that diffing shows correct filler lines
Bram Moolenaara80888d2012-10-21 22:18:21 +020082:windo :bw!
83:enew
84:put =range(4,10)
85:1d _
86:vnew
87:put =range(1,10)
88:1d _
89:windo :diffthis
90:wincmd h
91:let w0=line('w0')
92:enew
93:put =w0
94:.w >> test.out
Bram Moolenaar27823602015-07-28 14:42:45 +020095:unlet! one two three nodiffsettings diffsettings diff_fdm diff_fdc nd1 nd2 nd3 w0
Bram Moolenaar071d4272004-06-13 20:20:40 +000096:qa!
97ENDTEST
98
991 aa
1002 bb
1013 cc
1024 dd
1035 ee