2004
|
1 Test for multi-byte text formatting.
|
4029
|
2 Also test, that 'mps' with multibyte chars works.
|
4203
|
3 And test "ra" on multi-byte characters.
|
5413
|
4 Also test byteidx() and byteidxcomp()
|
2004
|
5
|
|
6 STARTTEST
|
|
7 :so mbyte.vim
|
|
8 :set encoding=utf-8
|
|
9 ENDTEST
|
|
10
|
|
11 Results of test69:
|
|
12
|
|
13 STARTTEST
|
|
14 /^{/+1
|
|
15 :set tw=2 fo=t
|
|
16 gqgqjgqgqo
|
|
17 XYZ
|
|
18 abc XYZ
|
|
19 ENDTEST
|
|
20
|
|
21 {
|
|
22 XYZ
|
|
23 abc XYZ
|
|
24 }
|
|
25
|
|
26 STARTTEST
|
|
27 /^{/+1
|
|
28 :set tw=1 fo=tm
|
|
29 gqgqjgqgqjgqgqjgqgqjgqgqo
|
|
30 X
|
|
31 Xa
|
|
32 X a
|
|
33 XY
|
|
34 X Y
|
|
35 ENDTEST
|
|
36
|
|
37 {
|
|
38 X
|
|
39 Xa
|
|
40 X a
|
|
41 XY
|
|
42 X Y
|
|
43 }
|
|
44
|
|
45 STARTTEST
|
|
46 /^{/+1
|
|
47 :set tw=2 fo=tm
|
|
48 gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
|
|
49 X
|
|
50 Xa
|
|
51 X a
|
|
52 XY
|
|
53 X Y
|
|
54 aX
|
|
55 abX
|
|
56 abcX
|
|
57 abX c
|
|
58 abXY
|
|
59 ENDTEST
|
|
60
|
|
61 {
|
|
62 X
|
|
63 Xa
|
|
64 X a
|
|
65 XY
|
|
66 X Y
|
|
67 aX
|
|
68 abX
|
|
69 abcX
|
|
70 abX c
|
|
71 abXY
|
|
72 }
|
|
73
|
|
74 STARTTEST
|
|
75 /^{/+1
|
|
76 :set ai tw=2 fo=tm
|
|
77 gqgqjgqgqo
|
|
78 X
|
|
79 Xa
|
|
80 ENDTEST
|
|
81
|
|
82 {
|
|
83 X
|
|
84 Xa
|
|
85 }
|
|
86
|
|
87 STARTTEST
|
|
88 /^{/+1
|
|
89 :set noai tw=2 fo=tm
|
|
90 gqgqjgqgqo
|
|
91 X
|
|
92 Xa
|
|
93 ENDTEST
|
|
94
|
|
95 {
|
|
96 X
|
|
97 Xa
|
|
98 }
|
|
99
|
|
100 STARTTEST
|
|
101 /^{/+1
|
|
102 :set tw=2 fo=cqm comments=n:X
|
|
103 gqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqjgqgqo
|
|
104 X
|
|
105 Xa
|
|
106 XaY
|
|
107 XY
|
|
108 XYZ
|
|
109 X Y
|
|
110 X YZ
|
|
111 XX
|
|
112 XXa
|
|
113 XXY
|
|
114 ENDTEST
|
|
115
|
|
116 {
|
|
117 X
|
|
118 Xa
|
|
119 XaY
|
|
120 XY
|
|
121 XYZ
|
|
122 X Y
|
|
123 X YZ
|
|
124 XX
|
|
125 XXa
|
|
126 XXY
|
|
127 }
|
|
128
|
|
129 STARTTEST
|
|
130 /^{/+1
|
|
131 :set tw=2 fo=tm
|
|
132 RXa
|
|
133 ENDTEST
|
|
134
|
|
135 {
|
|
136
|
|
137 }
|
|
138
|
|
139 STARTTEST
|
4029
|
140 /^{/+1
|
|
141 :set mps+=u2018:u2019
|
|
142 d%
|
|
143 ENDTEST
|
|
144
|
|
145 {
|
|
146 ‘ two three ’ four
|
|
147 }
|
|
148 STARTTEST
|
4203
|
149 /^ra test
|
|
150 jVjra
|
|
151 ENDTEST
|
|
152
|
|
153 ra test
|
|
154 abba
|
|
155 aab
|
|
156
|
|
157 STARTTEST
|
5682
|
158 :set whichwrap+=h
|
|
159 /^x
|
|
160 dh
|
|
161 :set whichwrap-=h
|
|
162 ENDTEST
|
|
163
|
|
164 á
|
|
165 x
|
|
166
|
|
167 STARTTEST
|
5413
|
168 :let a = '.é.' " one char of two bytes
|
|
169 :let b = '.é.' " normal e with composing char
|
|
170 /^byteidx
|
|
171 :put =string([byteidx(a, 0), byteidx(a, 1), byteidx(a, 2), byteidx(a, 3), byteidx(a, 4)])
|
|
172 :put =string([byteidx(b, 0), byteidx(b, 1), byteidx(b, 2), byteidx(b, 3), byteidx(b, 4)])
|
|
173 /^byteidxcomp
|
|
174 :put =string([byteidxcomp(a, 0), byteidxcomp(a, 1), byteidxcomp(a, 2), byteidxcomp(a, 3), byteidxcomp(a, 4)])
|
|
175 :let b = '.é.'
|
|
176 :put =string([byteidxcomp(b, 0), byteidxcomp(b, 1), byteidxcomp(b, 2), byteidxcomp(b, 3), byteidxcomp(b, 4), byteidxcomp(b, 5)])
|
|
177 ENDTEST
|
|
178
|
|
179 byteidx
|
|
180 byteidxcomp
|
|
181
|
|
182 STARTTEST
|
5964
|
183 /^substitute
|
|
184 :let y = substitute('123', '\zs', 'a', 'g') | put =y
|
|
185 ENDTEST
|
|
186
|
|
187 substitute
|
|
188
|
|
189 STARTTEST
|
2004
|
190 :g/^STARTTEST/.,/^ENDTEST/d
|
|
191 :1;/^Results/,$wq! test.out
|
|
192 ENDTEST
|