Mercurial > vim
annotate runtime/indent/testdir/vim.ok @ 32670:695b50472e85
Fix line endings issue
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 26 Jun 2023 13:13:12 +0200 |
parents | cc751d944b7e |
children | 94f4a488412e |
rev | line source |
---|---|
14970
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
1 " vim: set ft=vim sw=4 : |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
2 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
3 " START_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
4 func Some() |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
5 let x = 1 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
6 endfunc |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
7 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
8 let cmd = |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
9 \ 'some ' |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
10 \ 'string' |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
11 |
23737 | 12 if 1 |
13 let x = [ | |
14 \ ] | |
15 endif | |
16 | |
23931 | 17 for x in [ |
18 {key: 'value'}, | |
19 ] | |
20 eval 0 | |
21 endfor | |
22 | |
29274 | 23 let t = [ |
24 \ { | |
25 \ 'k': 'val', | |
26 \ }, | |
27 \ ] | |
28 | |
30085 | 29 def Func() |
30 var d = dd | |
30547 | 31 ->extend({ |
32 }) | |
30085 | 33 eval 0 |
34 enddef | |
14970
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
35 " END_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
36 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
37 " START_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
38 " INDENT_EXE let g:vim_indent_cont = 6 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
39 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
40 let cmd = |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
41 \ 'some ' |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
42 \ 'string' |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
43 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
44 " END_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
45 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
46 " START_INDENT |
23573 | 47 " INDENT_EXE let g:vim_indent_cont = 5 |
48 | |
49 let list = [ | |
50 \ 'one', | |
51 \ 'two'] | |
52 | |
53 " END_INDENT | |
54 | |
55 " START_INDENT | |
14970
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
56 " INDENT_EXE unlet g:vim_indent_cont |
23573 | 57 |
58 let list = [ | |
59 'one', | |
60 'two', | |
30547 | 61 ] |
23573 | 62 echo |
63 | |
64 " END_INDENT | |
65 | |
66 " START_INDENT | |
14970
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
67 " INDENT_AT this-line |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
68 func Some() |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
69 let f = x " this-line |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
70 endfunc |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
71 " END_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
72 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
73 " START_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
74 " INDENT_NEXT next-line |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
75 func Some() |
30547 | 76 " next-line |
77 let f = x | |
14970
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
78 endfunc |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
79 " END_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
80 |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
81 " START_INDENT |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
82 " INDENT_PREV prev-line |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
83 func Some() |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
84 let f = x |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
85 " prev-line |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
86 endfunc |
19b757c6c6a7
patch 8.1.0496: no tests for indent files
Bram Moolenaar <Bram@vim.org>
parents:
diff
changeset
|
87 " END_INDENT |
18489 | 88 |
89 " START_INDENT | |
90 let a =<< END | |
30547 | 91 nothing |
92 END | |
93 " END_INDENT | |
94 | |
95 " START_INDENT | |
96 let a =<< trim END | |
18489 | 97 nothing |
98 END | |
99 " END_INDENT | |
100 | |
101 " START_INDENT | |
102 " INDENT_AT this-line | |
103 let a=<< trim END | |
104 blah | |
105 blah | |
106 blah this-line | |
107 END | |
108 " END_INDENT | |
30547 | 109 |
110 " START_INDENT | |
111 if v:true | |
112 echo 0 | |
113 end | |
114 " END_INDENT | |
115 | |
116 " START_INDENT | |
117 var result = Func( | |
118 arg1, | |
119 arg2 | |
120 ) | |
121 " END_INDENT | |
122 | |
123 " START_INDENT | |
124 var result = Func(arg1, | |
125 arg2) | |
126 " END_INDENT | |
127 | |
128 " START_INDENT | |
129 filter(list, (k, v) => | |
130 v > 0) | |
131 " END_INDENT | |
132 | |
133 " START_INDENT | |
134 filter(list, (k, v) => { | |
135 const x = get(list, k, 0) | |
136 return x > 0 | |
137 }) | |
138 " END_INDENT | |
139 | |
140 " START_INDENT | |
141 if x > 0 | |
142 filter(list, (k, v) => { | |
143 const x = get(list, k, 1) | |
144 return x > 0 | |
145 }) | |
146 endif | |
147 " END_INDENT | |
148 | |
149 " START_INDENT | |
150 { | |
151 var temp = 'temp' | |
152 } | |
153 " END_INDENT | |
154 | |
155 " START_INDENT | |
156 var text = lead | |
157 .. middle | |
158 .. end | |
159 " END_INDENT | |
160 | |
161 " START_INDENT | |
162 var text = lead .. | |
163 middle .. | |
164 end | |
165 " END_INDENT | |
166 | |
167 " START_INDENT | |
168 var total = start + | |
169 end - | |
170 correction | |
171 " END_INDENT | |
172 | |
173 " START_INDENT | |
174 var result = start | |
175 :+ print | |
176 " END_INDENT | |
177 | |
178 " START_INDENT | |
179 var result = positive | |
180 ? PosFunc(arg) | |
181 : NegFunc(arg) | |
182 " END_INDENT | |
183 | |
184 " START_INDENT | |
185 var result = GetBuilder() | |
186 ->BuilderSetWidth(333) | |
187 ->BuilderSetHeight(777) | |
188 ->BuilderBuild() | |
189 " END_INDENT | |
190 | |
191 " START_INDENT | |
192 var result = MyDict | |
193 .member | |
194 " END_INDENT | |
195 | |
196 " START_INDENT | |
197 autocmd BufNewFile *.match if condition | |
198 | echo 'match' | |
199 | endif | |
200 " END_INDENT | |
201 | |
202 " START_INDENT | |
203 set cpo+=C | |
204 var lines =<< trim END | |
205 | this works | |
206 END | |
207 set cpo-=C | |
208 " END_INDENT | |
209 | |
210 " START_INDENT | |
211 syn region Text | |
212 \ start='foo' | |
213 #\ comment | |
214 \ end='bar' | |
215 " END_INDENT | |
216 | |
217 " START_INDENT | |
218 au CursorHold * echom 'BEFORE bar' | |
219 #\ some comment | |
220 | echom 'AFTER bar' | |
221 " END_INDENT | |
222 | |
223 " START_INDENT | |
224 def MyFunc(text: string, | |
225 separator = '-' | |
226 ): string | |
227 enddef | |
228 " END_INDENT | |
229 | |
230 " START_INDENT | |
231 def MyFunc( | |
232 text: string, | |
233 separator = '-' | |
234 ): string | |
235 enddef | |
236 " END_INDENT | |
237 | |
238 " START_INDENT | |
239 [var1, var2] = | |
240 Func() | |
241 " END_INDENT | |
242 | |
243 " START_INDENT | |
244 const list = ['one', | |
245 'two'] | |
246 " END_INDENT | |
247 | |
248 " START_INDENT | |
249 const list = [ | |
250 'one', | |
251 'two', | |
252 ] | |
253 " END_INDENT | |
254 | |
255 " START_INDENT | |
256 const dict = {one: 1, | |
257 two: 2 | |
258 } | |
259 " END_INDENT | |
260 | |
261 " START_INDENT | |
262 const dict = { | |
263 one: 1, | |
264 two: 2 | |
265 } | |
266 " END_INDENT | |
267 | |
268 " START_INDENT | |
269 if true | |
270 const dict = | |
271 { | |
272 one: 1, | |
273 two: 2 | |
274 } | |
275 endif | |
276 " END_INDENT | |
277 | |
278 " START_INDENT | |
279 def Func() | |
280 return { | |
281 one: 1 | |
282 } | |
283 enddef | |
284 " END_INDENT | |
285 | |
286 " START_INDENT | |
287 echo { | |
288 a: 0, | |
289 # b | |
290 # c | |
291 } | |
292 " END_INDENT | |
293 | |
294 " START_INDENT | |
295 echo search( | |
296 # comment | |
297 '1' | |
298 .. '2' | |
299 ) | |
300 " END_INDENT | |
301 | |
302 " START_INDENT | |
303 if true | |
304 var v = ( # trailing "(" starts line continuation | |
305 3 + 4 # nothing special | |
306 ) # end of expression indicates continued line | |
307 var x: number # needs to align with previous "var" | |
308 endif | |
309 " END_INDENT | |
310 | |
311 " START_INDENT | |
312 def Func() # {{{ | |
313 # comment | |
314 if true | |
315 return | |
316 endif | |
317 enddef | |
318 " END_INDENT | |
319 | |
320 " START_INDENT | |
321 echo { | |
322 key: | |
323 'value', | |
324 } | |
325 " END_INDENT | |
326 | |
327 " START_INDENT | |
328 var id = time | |
329 ->timer_start((_) => { | |
330 n = 0 | |
331 }) | |
332 " END_INDENT | |
333 | |
334 " START_INDENT | |
335 augroup Name | |
336 autocmd! | |
337 augroup END | |
338 " END_INDENT | |
339 | |
340 " START_INDENT | |
341 var n = | |
342 # comment | |
343 1 | |
344 + 2 | |
345 | |
346 var s = '' | |
347 " END_INDENT | |
348 | |
349 " START_INDENT | |
350 var keys = { | |
351 J: 'j', | |
352 "\<Home>": '1G', | |
353 "\<End>": 'G', | |
354 z: 'zz' | |
355 } | |
356 " END_INDENT | |
357 | |
358 " START_INDENT | |
359 export def Func( | |
360 n: number, | |
361 s: string, | |
362 ...l: list<bool> | |
363 ) | |
364 enddef | |
365 " END_INDENT | |
366 | |
367 " START_INDENT | |
368 var heredoc =<< trim ENDD | |
369 var nested_heredoc =<< trim END | |
370 END | |
371 ENDD | |
372 " END_INDENT | |
373 | |
374 " START_INDENT | |
375 if true | |
376 else " comment | |
377 endif | |
378 " END_INDENT | |
379 | |
380 " START_INDENT | |
381 if true | echo 'one' | endif | |
382 if true | echo 'two' | endif | |
383 if true | echo 'three' | endif | |
384 " END_INDENT | |
385 | |
386 " START_INDENT | |
387 if true | |
388 :'<-1 mark < | |
389 else | |
390 echo '' | |
391 endif | |
392 " END_INDENT | |
393 | |
394 " START_INDENT | |
395 substitute/pat /rep / | |
396 echo | |
397 " END_INDENT | |
398 | |
399 " START_INDENT | |
400 try | |
401 echo 1 | |
402 catch /pat / # comment | |
403 echo 2 | |
404 endtry | |
405 " END_INDENT | |
406 | |
407 " START_INDENT | |
408 def Func() | |
409 Cmd % | |
410 enddef | |
411 " END_INDENT | |
412 | |
413 " START_INDENT | |
414 if end == 'xxx' || end == 'yyy' | |
415 echo | |
416 endif | |
417 " END_INDENT | |
418 | |
419 " START_INDENT | |
420 if true | |
421 popup_move(id, {col: 1, | |
422 line: 2}) | |
423 endif | |
424 setwinvar(id, 'name', 3) | |
425 " END_INDENT | |
426 | |
427 " START_INDENT | |
428 var d = [ | |
429 {a: 'x', | |
430 b: 'y'}, | |
431 FuncA(), | |
432 FuncB(), | |
433 ] | |
434 " END_INDENT | |
435 | |
436 " START_INDENT | |
437 var ll = [[ | |
438 1, | |
439 2, | |
440 3], [ | |
441 4, | |
442 5, | |
443 6], [ | |
444 7, | |
445 8, | |
446 9]] | |
447 " END_INDENT | |
448 | |
449 " START_INDENT | |
450 var ld = [{ | |
451 a: 'xxx', | |
452 b: 'yyy'}, { | |
453 c: 'xxx', | |
454 d: 'yyy'}, { | |
455 e: 'xxx', | |
456 f: 'yyy'}, { | |
457 }] | |
458 " END_INDENT | |
459 | |
460 " START_INDENT | |
461 var d = { | |
462 a: { | |
463 b: { | |
464 c: [{ | |
465 d: 'e', | |
466 f: 'g', | |
467 h: 'i' | |
468 }], | |
469 j: 'k', | |
470 }, | |
471 }, | |
472 } | |
473 " END_INDENT | |
474 | |
475 " START_INDENT | |
476 if true | |
477 var end: any | |
478 if true | |
479 end = 0 | |
480 elseif true | |
481 echo | |
482 endif | |
483 endif | |
484 " END_INDENT | |
485 | |
486 " START_INDENT | |
487 nunmap <buffer> ( | |
488 nunmap <buffer> ) | |
489 inoremap [ { | |
490 inoremap ] } | |
491 silent! xunmap i{ | |
492 silent! xunmap a{ | |
493 " END_INDENT | |
494 | |
495 " START_INDENT | |
496 def Func( | |
497 s: string, | |
498 n = 1, | |
499 m = 2 | |
500 ) | |
501 enddef | |
502 " END_INDENT | |
503 | |
504 " START_INDENT | |
505 var h =<< END | |
506 text | |
507 END | |
508 | |
509 def Func() | |
510 echo | |
511 enddef | |
512 " END_INDENT | |
513 | |
514 " START_INDENT | |
515 def Func() | |
516 var h =<< END | |
517 text | |
518 END | |
519 echo 'test' | |
520 enddef | |
521 " END_INDENT | |
522 | |
523 " START_INDENT | |
524 def Foo() | |
525 lcd - | |
526 enddef | |
527 def Bar() | |
528 echo | |
529 enddef | |
530 " END_INDENT | |
531 | |
532 " START_INDENT | |
533 if true | |
534 n = Func(1, 2, | |
535 3) | |
536 endif | |
537 " END_INDENT | |
538 | |
539 " START_INDENT | |
540 def Func(s: string, | |
541 n: number): bool | |
542 if true | |
543 return false | |
544 endif | |
545 enddef | |
546 " END_INDENT | |
547 | |
548 " START_INDENT | |
549 def Func( | |
550 n: number) | |
551 # | |
552 echo | |
553 enddef | |
554 " END_INDENT | |
555 | |
556 " START_INDENT | |
557 " INDENT_AT this-line | |
558 def Func( | |
559 n: number) | |
560 # | |
561 echo # this-line | |
562 enddef | |
563 " END_INDENT | |
564 | |
565 " START_INDENT | |
566 if true | |
567 if true | |
568 normal! == | |
569 endif | |
570 endif | |
571 " END_INDENT | |
572 | |
573 " START_INDENT | |
574 var d = { | |
575 a: () => true, | |
576 b: () => true | |
577 && true | |
578 && Foo(), | |
579 c: () => Bar(), | |
580 e: () => Baz(), | |
581 } | |
582 " END_INDENT | |
583 | |
584 " START_INDENT | |
585 def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) | |
586 return (Emit: func(any)) => { | |
587 Cont((t: any) => { | |
588 if Pred(t) | |
589 Emit(t) | |
590 endif | |
591 }) | |
592 } | |
593 enddef | |
594 " END_INDENT | |
595 | |
596 " START_INDENT | |
597 " INDENT_EXE let g:vim_indent = {'more_in_bracket_block': v:true} | |
598 def Select(Cont: func(func(any)), Pred: func(any): bool): func(func(any)) | |
599 return (Emit: func(any)) => { | |
600 Cont((t: any) => { | |
601 if Pred(t) | |
602 Emit(t) | |
603 endif | |
604 }) | |
605 } | |
606 enddef | |
607 " END_INDENT | |
608 | |
609 " START_INDENT | |
610 " INDENT_EXE unlet! g:vim_indent | |
611 " END_INDENT | |
612 | |
613 " START_INDENT | |
614 g:lightline = { | |
615 'active': { | |
616 'left': [ [ 'mode', 'paste' ], [ 'readonly', 'relativepath', 'modified' ] ], | |
617 }, | |
618 'inactive': { | |
619 'left': [ [ 'readonly', 'relativepath', 'modified' ] ], | |
620 } | |
621 } | |
622 " END_INDENT | |
623 | |
624 " START_INDENT | |
625 if getline(1, 10) | |
626 ->map((_, v: string): number => strcharlen(v)) | |
627 ->max() > 1'000 | |
628 &l:breakindent = false | |
629 &l:linebreak = false | |
630 else | |
631 &l:breakindent = true | |
632 &l:linebreak = true | |
633 endif | |
634 " END_INDENT | |
635 | |
636 " START_INDENT | |
637 var ext2cmd: dict<string> = { | |
638 doc: $'antiword {fname}', | |
639 docx: $'pandoc --from=docx --to=markdown {fname}', | |
640 epub: $'pandoc --from=epub --to=markdown {fname}', | |
641 odp: $'odt2txt {fname}', | |
642 odt: $'odt2txt {fname}', | |
643 pdf: $'pdftotext -nopgbrk -layout -q -eol unix {fname} -', | |
644 rtf: 'unrtf --text', | |
645 } | |
646 " END_INDENT | |
647 | |
648 " START_INDENT | |
649 const ptybuf: number = term_start(&shell, { | |
650 hidden: true, | |
651 exit_cb: (_, _) => { | |
652 if true | |
653 close | |
654 else | |
655 help | |
656 endif | |
657 } | |
658 }) | |
659 " END_INDENT | |
660 | |
661 " START_INDENT | |
662 var d = { | |
663 a: 0, | |
664 # a ' quote {{{ | |
665 #}}} | |
666 b: 0, | |
667 } | |
668 " END_INDENT | |
669 | |
670 " START_INDENT | |
671 echo printf('%s () %s', | |
672 1, | |
673 2 | |
674 ) | |
675 " END_INDENT | |
676 | |
677 " START_INDENT | |
678 prop_add(1, col('.'), { | |
679 length: 2, | |
680 type: 'test' | |
681 }) | |
682 " END_INDENT | |
683 | |
684 " START_INDENT | |
685 echo (() => " string starting with space")() | |
686 echo | |
687 " END_INDENT | |
688 | |
689 " START_INDENT | |
690 var variables = deepcopy(g:) | |
691 ->filter((k: string, _): bool => | |
692 k =~ '\c\V' .. keyword->escape('\') | |
693 && k !~ '\%(loaded\|did_plugin_\)') | |
694 ->items() | |
695 ->map((_, v): string => v[0] .. ' = ' .. string(v[1])) | |
696 new | |
697 " END_INDENT | |
698 | |
699 " START_INDENT | |
700 var d = freq | |
701 ->map((_, v) => | |
702 v * ( | |
703 1 | |
704 + 2 | |
705 )) | |
706 for item in d | |
707 ->items() | |
708 ->sort((a, b) => b[1] - a[1]) | |
709 echo | |
710 endfor | |
711 " END_INDENT | |
712 | |
713 " START_INDENT | |
714 make_job = job_start([&shell, &shellcmdflag, make_cmd], { | |
715 callback: function(MakeProcessOutput, [qfid]), | |
716 close_cb: function(MakeCloseCb, [qfid]), | |
717 exit_cb: MakeCompleted, | |
718 in_io: 'null' | |
719 }) | |
720 " END_INDENT | |
721 | |
722 " START_INDENT | |
723 var matching_abbrev: list<dict<string>> = copy(ABBREV) | |
724 ->filter((_, v: dict<string>): bool => | |
725 stridx(v.lhs, word_to_complete) == 0) | |
726 ->map((_, v: dict<string>) => ({ | |
727 word: v.lhs, | |
728 menu: AbbrevRhs(v.rhs)->stridx('expand_') >= 0 | |
729 ? AbbrevRhs(v.rhs)->matchstr('.*,\s*''\zs.*\ze'')') | |
730 : AbbrevRhs(v.rhs) | |
731 })) | |
732 " END_INDENT | |
733 | |
734 " START_INDENT | |
735 def Func() | |
736 if true | |
737 vimgrep /^\C\s*\%(fu\%[nction]\|def\)\s\+/ file | |
738 endif | |
739 enddef | |
740 " END_INDENT | |
741 | |
742 " START_INDENT | |
743 setlocal iskeyword+=[ | |
744 cword = expand('<cword>') | |
745 " END_INDENT | |
746 | |
747 " START_INDENT | |
748 silent if true | |
749 echo | |
750 endif | |
751 " END_INDENT | |
752 | |
753 " START_INDENT | |
754 def Func() | |
755 sort :^.*[\/]: | |
756 enddef | |
757 " END_INDENT | |
758 | |
759 " START_INDENT | |
760 def Func() | |
761 d = { | |
762 } | |
763 hd =<< trim END | |
764 [' | |
765 ]' | |
766 END | |
767 enddef | |
768 " END_INDENT | |
769 | |
770 " START_INDENT | |
771 def Func() | |
772 if true | |
773 var hd =<< trim END | |
774 if get(b:, 'current_syntax', '') | |
775 endif | |
776 END | |
777 elseif true | |
778 echo | |
779 endif | |
780 enddef | |
781 " END_INDENT | |
782 | |
783 " START_INDENT | |
784 # test for control-flow keyword followed by commented fold marker {{{ | |
785 if true | |
786 echo | |
787 endif #}}} | |
788 " END_INDENT | |
789 | |
790 " START_INDENT | |
791 if winsz == 0|let winsz= ""|endif | |
792 exe "noswapfile ".winsz."wincmd s" | |
793 " END_INDENT | |
794 | |
795 " START_INDENT | |
796 if true | |
797 if true | |
798 windo if true | echo | endif | |
799 augroup Name | |
800 autocmd WinLeave * if true | eval 1 + 2 | endif | |
801 augroup END | |
802 endif | |
803 endif | |
804 " END_INDENT | |
805 | |
806 " START_INDENT | |
807 if true | |
808 echo ' =<< trim END' | |
809 ->len() | |
810 endif | |
811 " END_INDENT | |
812 | |
813 " START_INDENT | |
814 function Func() | |
815 if true | |
816 if true | |
817 if true | echo com | endif | |
818 if true | echo com | endif | |
819 endif | |
820 else | |
821 endif | |
822 endfunction | |
823 " END_INDENT | |
824 | |
825 " START_INDENT | |
826 function Func() | |
827 if v:true | |
828 + | |
829 echo | |
830 - | |
831 endif | |
832 endfunction | |
833 " END_INDENT | |
834 | |
835 " START_INDENT | |
836 var matchpairs: string = &matchpairs | |
837 var pairs: dict<list<string>> | |
838 for [opening: string, closing: string] | |
839 in matchpairs | |
840 ->split(',') | |
841 ->map((_, v: string): list<string> => split(v, ':')) | |
842 pairs[opening] = [escape(opening, '[]'), escape(closing, '[]'), 'nW', 'w$'] | |
843 pairs[closing] = [escape(opening, '[]'), escape(closing, '[]'), 'bnW', 'w0'] | |
844 endfor | |
845 " END_INDENT | |
846 | |
847 " START_INDENT | |
848 { | |
849 echo [] | |
850 + [] | |
851 + [{a: 1, | |
30875 | 852 b: 2}] |
30547 | 853 } |
854 " END_INDENT | |
855 | |
856 " START_INDENT | |
857 silent! argdel * | |
858 edit file | |
859 " END_INDENT | |
30634 | 860 |
861 " START_INDENT | |
862 def Foo() | |
863 Bar(1, | |
864 []->filter((_, v) => { | |
865 return true | |
866 }), | |
867 () => { | |
868 echo | |
869 }) | |
870 enddef | |
871 " END_INDENT | |
30875 | 872 |
873 " START_INDENT | |
874 echo { | |
875 k: () => { | |
876 if true | |
877 echo | |
878 popup_setoptions(id, | |
879 {title: 'title'}) | |
880 endif | |
881 } | |
882 } | |
883 " END_INDENT | |
884 | |
885 " START_INDENT | |
886 if true | |
887 elseif | |
888 endif | |
889 " END_INDENT | |
31885 | 890 |
891 " START_INDENT | |
892 if ( | |
893 true) | |
894 && true | |
895 echo | |
896 endif | |
897 " END_INDENT | |
898 | |
899 " START_INDENT | |
900 abstract class Shape | |
901 this.color = Color.Black | |
902 this.thickness = 10 | |
903 endclass | |
904 " END_INDENT | |
905 | |
906 " START_INDENT | |
907 class OtherThing | |
908 this.size: number | |
909 static totalSize: number | |
910 | |
911 static def ClearTotalSize(): number | |
912 var prev = totalSize | |
913 totalSize = 0 | |
914 return prev | |
915 enddef | |
916 endclass | |
917 " END_INDENT | |
918 | |
919 " START_INDENT | |
920 interface HasSurface | |
921 this.size: number | |
922 def Surface(): number | |
923 endinterface | |
924 " END_INDENT | |
925 | |
926 " START_INDENT | |
927 interface EnterExit | |
928 def Enter(): void | |
929 def Exit(): void | |
930 endinterface | |
931 " END_INDENT | |
932 | |
933 " START_INDENT | |
934 enum Color | |
935 White | |
936 Red | |
937 Green | |
938 Blue | |
939 Black | |
940 endenum | |
941 " END_INDENT |