summaryrefslogtreecommitdiff
path: root/src/testdir/test61.in
blob: dc24ab980443fd13140f03f5f6269c04d0f4e932 (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
110
111
112
113
Tests for undo tree.
Since this script is sourced we need to explicitly break changes up in
undo-able pieces.  Do that by setting 'undolevels'.
Also tests :earlier and :later.

STARTTEST
:echo undotree().entries
ENDTEST

STARTTEST
:" Delete three characters and undo
Gx:set ul=100
x:set ul=100
x:.w! test.out
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
:"
:/^111/w >>test.out
:" Delete three other characters and go back in time step by step
$x:set ul=100
x:set ul=100
x:.w >>test.out
:sleep 1
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
g-:.w >>test.out
10g+:.w >>test.out
:"
:/^222/w >>test.out
:" Delay for three seconds and go some seconds forward and backward
:sleep 2
Aa:set ul=100
Ab:set ul=100
Ac:set ul=100
:.w >>test.out
:ear 1s
:.w >>test.out
:ear 3s
:.w >>test.out
:later 1s
:.w >>test.out
:later 1h
:.w >>test.out
:"
:" test undojoin
Goaaaa:set ul=100
obbbbu:.w >>test.out
obbbb:set ul=100
:undojoin
occccu:.w >>test.out
:e! Xtest
ione one one:set ul=100
:w!
otwo:set ul=100
otwo:set ul=100
:w
othree:earlier 1f
:" expect "one one one\ntwo\ntwo"
:%yank a
:earlier 1f
:" expect "one one one"
:%yank b
:earlier 1f
:" expect empty line
:%yank c
:later 1f
:" expect "one one one"
:%yank d
:later 1f
:" expect "one one one\ntwo\ntwo"
:%yank e
:later 1f
:" expect "one one one\ntwo\ntwo\nthree"
ggO---:0put e
ggO---:0put d
ggO---:0put c
ggO---:0put b
ggO---:0put a
ggO---:w >>test.out
:so small.vim
:set nocp viminfo+=nviminfo
:enew!
oa
:set ul=100
ob
:set ul=100
o1a2=setline('.','1234')

uu:"
oc
:set ul=100
o1a2=setline('.','1234')

u:"
od
:set ul=100
o1a2=string(123)
u:"
:%w >>test.out
:qa!
ENDTEST

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

123456789