summaryrefslogtreecommitdiff
path: root/src/testdir/test72.in
blob: 6acb6d8f4acb2ba8e70ce929817d597fb48ad11f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Tests for undo file.
Since this script is sourced we need to explicitly break changes up in
undo-able pieces.  Do that by setting 'undolevels'.

STARTTEST
:so small.vim
:"
:" Test 'undofile': first a simple one-line change.
:set nocompatible viminfo+=nviminfo visualbell
:set ul=100 undofile nomore
:e! Xtestfile
ggdGithis is one line:set ul=100
:s/one/ONE/
:set ul=100
:w
:bwipe!
:e Xtestfile
u:.w! test.out
:"
:" Test 'undofile', change in original file fails check
:set noundofile
:e! Xtestfile
:s/line/Line/
:w
:set undofile
:bwipe!
:e Xtestfile
:" TODO: this beeps
u:.w >>test.out
:"
:" Test 'undofile', add 10 lines, delete 6 lines, undo 3
:set undofile
ggdGione
two
three
four
five
six
seven
eight
nine
ten:set ul=100
3Gdd:set ul=100
dd:set ul=100
dd:set ul=100
dd:set ul=100
dd:set ul=100
dd:set ul=100
:w
:bwipe!
:e Xtestfile
uuu:w >>test.out
:"
:" And now with encryption, cryptmethod=zip
:e! Xtestfile
:set undofile cm=zip
ggdGimonday
tuesday
wednesday
thursday
friday:set ul=100
kkkdd:set ul=100
dd:set ul=100
dd:set ul=100
:X
foobar
foobar
:w!
:bwipe!
:e Xtestfile
foobar
:set key=
uu:w >>test.out
:"
:"
:" With encryption, cryptmethod=blowfish
:e! Xtestfile
:set undofile cm=blowfish
ggdGijan
feb
mar
apr
jun:set ul=100
kk0ifoo :set ul=100
dd:set ul=100
ibar :set ul=100
:X
foobar
foobar
:w!
:bwipe!
:e Xtestfile
foobar
:set key=
/bar
:.w >>test.out
u:.w >>test.out
u:.w >>test.out
u:.w >>test.out
:"
:" Rename the undo file so that it gets cleaned up.
:call rename(".Xtestfile.un~", "Xtestundo")
:qa!
ENDTEST

1111 -----
2222 -----

123456789