Mercurial > vim
annotate runtime/ftplugin/cucumber.vim @ 19940:724417668d42 v8.2.0526
patch 8.2.0526: Gcc 9 complains about empty statement
Commit: https://github.com/vim/vim/commit/86b9a3e8cd24335195dbe377b98bed1ba291268d
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Apr 7 19:57:29 2020 +0200
patch 8.2.0526: Gcc 9 complains about empty statement
Problem: Gcc 9 complains about empty statement.
Solution: Add {}. (Dominique Pelle, closes https://github.com/vim/vim/issues/5894)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 07 Apr 2020 20:00:04 +0200 |
parents | 43efa4f5a8ea |
children |
rev | line source |
---|---|
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
1 " Vim filetype plugin |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
2 " Language: Cucumber |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
4 " Last Change: 2016 Aug 29 |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
5 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
6 " Only do this when not done yet for this buffer |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
7 if (exists("b:did_ftplugin")) |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
8 finish |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
9 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
10 let b:did_ftplugin = 1 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
11 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
12 let s:keepcpo= &cpo |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
13 set cpo&vim |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
14 |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
15 setlocal formatoptions-=t formatoptions+=croql |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
16 setlocal comments=:# commentstring=#\ %s |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
17 setlocal omnifunc=CucumberComplete |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
18 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
19 let b:undo_ftplugin = "setl fo< com< cms< ofu<" |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
20 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
21 let b:cucumber_root = expand('%:p:h:s?.*[\/]\%(features\|stories\)\zs[\/].*??') |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
22 if !exists("b:cucumber_steps_glob") |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
23 let b:cucumber_steps_glob = b:cucumber_root.'/**/*.rb' |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
24 endif |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
25 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
26 if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps") |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
27 cnoremap <SID>foldopen <Bar>if &foldopen =~# 'tag'<Bar>exe 'norm! zv'<Bar>endif |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
28 nnoremap <silent> <script> <buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
29 nnoremap <silent> <script> <buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<SID>foldopen<CR> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
30 nnoremap <silent> <script> <buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
31 nnoremap <silent> <script> <buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<SID>foldopen<CR> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
32 nnoremap <silent> <script> <buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR> |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
33 nnoremap <silent> <script> <buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR> |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
34 let b:undo_ftplugin .= |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
35 \ "|sil! nunmap <buffer> [<C-D>" . |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
36 \ "|sil! nunmap <buffer> ]<C-D>" . |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
37 \ "|sil! nunmap <buffer> <C-W>d" . |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
38 \ "|sil! nunmap <buffer> <C-W><C-D>" . |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
39 \ "|sil! nunmap <buffer> [d" . |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
40 \ "|sil! nunmap <buffer> ]d" |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
41 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
42 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
43 function! s:jump(command,count) |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
44 let steps = s:steps('.') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
45 if len(steps) == 0 || len(steps) < a:count |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
46 return 'echoerr "No matching step found"' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
47 elseif len(steps) > 1 && !a:count |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
48 return 'echoerr "Multiple matching steps found"' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
49 else |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
50 let c = a:count ? a:count-1 : 0 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
51 return a:command.' +'.steps[c][1].' '.escape(steps[c][0],' %#') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
52 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
53 endfunction |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
54 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
55 function! s:allsteps() |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
56 let step_pattern = '\C^\s*\K\k*\>\s*(\=\s*\zs\S.\{-\}\ze\s*)\=\s*\%(do\|{\)\s*\%(|[^|]*|\s*\)\=\%($\|#\)' |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
57 let steps = [] |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
58 for file in split(glob(b:cucumber_steps_glob),"\n") |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
59 let lines = readfile(file) |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
60 let num = 0 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
61 for line in lines |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
62 let num += 1 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
63 if line =~ step_pattern |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
64 let type = matchstr(line,'\w\+') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
65 let steps += [[file,num,type,matchstr(line,step_pattern)]] |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
66 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
67 endfor |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
68 endfor |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
69 return steps |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
70 endfunction |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
71 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
72 function! s:steps(lnum) |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
73 let c = match(getline(a:lnum), '\S') + 1 |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
74 while synIDattr(synID(a:lnum,c,1),'name') !~# '^$\|Region$' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
75 let c = c + 1 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
76 endwhile |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
77 let step = matchstr(getline(a:lnum)[c-1 : -1],'^\s*\zs.\{-\}\ze\s*$') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
78 return filter(s:allsteps(),'s:stepmatch(v:val[3],step)') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
79 endfunction |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
80 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
81 function! s:stepmatch(receiver,target) |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
82 if a:receiver =~ '^[''"].*[''"]$' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
83 let pattern = '^'.escape(substitute(a:receiver[1:-2],'$\w\+','(.*)','g'),'/').'$' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
84 elseif a:receiver =~ '^/.*/$' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
85 let pattern = a:receiver[1:-2] |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
86 elseif a:receiver =~ '^%r..*.$' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
87 let pattern = escape(a:receiver[3:-2],'/') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
88 else |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
89 return 0 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
90 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
91 try |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
92 let vimpattern = substitute(substitute(pattern,'\\\@<!(?:','%(','g'),'\\\@<!\*?','{-}','g') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
93 if a:target =~# '\v'.vimpattern |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
94 return 1 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
95 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
96 catch |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
97 endtry |
2526
713a4965ee7f
Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents:
2202
diff
changeset
|
98 if has("ruby") && pattern !~ '\\\@<!#{' |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
99 ruby VIM.command("return #{if (begin; Kernel.eval('/'+VIM.evaluate('pattern')+'/'); rescue SyntaxError; end) === VIM.evaluate('a:target') then 1 else 0 end}") |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
100 else |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
101 return 0 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
102 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
103 endfunction |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
104 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
105 function! s:bsub(target,pattern,replacement) |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
106 return substitute(a:target,'\C\\\@<!'.a:pattern,a:replacement,'g') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
107 endfunction |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
108 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
109 function! CucumberComplete(findstart,base) abort |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
110 let indent = indent('.') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
111 let group = synIDattr(synID(line('.'),indent+1,1),'name') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
112 let type = matchstr(group,'\Ccucumber\zs\%(Given\|When\|Then\)') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
113 let e = matchend(getline('.'),'^\s*\S\+\s') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
114 if type == '' || col('.') < col('$') || e < 0 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
115 return -1 |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
116 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
117 if a:findstart |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
118 return e |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
119 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
120 let steps = [] |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
121 for step in s:allsteps() |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
122 if step[2] ==# type |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
123 if step[3] =~ '^[''"]' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
124 let steps += [step[3][1:-2]] |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
125 elseif step[3] =~ '^/\^.*\$/$' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
126 let pattern = step[3][2:-3] |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
127 let pattern = substitute(pattern,'\C^(?:|I )','I ','') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
128 let pattern = s:bsub(pattern,'\\[Sw]','w') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
129 let pattern = s:bsub(pattern,'\\d','1') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
130 let pattern = s:bsub(pattern,'\\[sWD]',' ') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
131 let pattern = s:bsub(pattern,'\[\^\\\="\]','_') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
132 let pattern = s:bsub(pattern,'[[:alnum:]. _-][?*]?\=','') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
133 let pattern = s:bsub(pattern,'\[\([^^]\).\{-\}\]','\1') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
134 let pattern = s:bsub(pattern,'+?\=','') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
135 let pattern = s:bsub(pattern,'(\([[:alnum:]. -]\{-\}\))','\1') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
136 let pattern = s:bsub(pattern,'\\\([[:punct:]]\)','\1') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
137 if pattern !~ '[\\()*?]' |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
138 let steps += [pattern] |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
139 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
140 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
141 endif |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
142 endfor |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
143 call filter(steps,'strpart(v:val,0,strlen(a:base)) ==# a:base') |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
144 return sort(steps) |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
145 endfunction |
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
146 |
4681
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
147 let &cpo = s:keepcpo |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
148 unlet s:keepcpo |
2eb30f341e8d
Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents:
2526
diff
changeset
|
149 |
2098
3259c3923c1e
Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff
changeset
|
150 " vim:set sts=2 sw=2: |