annotate runtime/ftplugin/cucumber.vim @ 8716:4ce26276caeb v7.4.1647

commit https://github.com/vim/vim/commit/8b20179c657b4266dff115486ca68c6a50324071 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 25 15:01:10 2016 +0100 patch 7.4.1647 Problem: Using freed memory after setqflist() and ":caddbuffer". (Dominique) Solution: Set qf_ptr when adding the first item to the quickfix list.
author Christian Brabandt <cb@256bit.org>
date Fri, 25 Mar 2016 15:15:04 +0100
parents 2eb30f341e8d
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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>
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
4 " Last Change: 2013 Jun 01
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[\/].*??')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
22
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
23 if !exists("g:no_plugin_maps") && !exists("g:no_cucumber_maps")
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
24 nnoremap <silent><buffer> <C-]> :<C-U>exe <SID>jump('edit',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
25 nnoremap <silent><buffer> [<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
26 nnoremap <silent><buffer> ]<C-D> :<C-U>exe <SID>jump('edit',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
27 nnoremap <silent><buffer> <C-W>] :<C-U>exe <SID>jump('split',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
28 nnoremap <silent><buffer> <C-W><C-]> :<C-U>exe <SID>jump('split',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
29 nnoremap <silent><buffer> <C-W>d :<C-U>exe <SID>jump('split',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
30 nnoremap <silent><buffer> <C-W><C-D> :<C-U>exe <SID>jump('split',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
31 nnoremap <silent><buffer> <C-W>} :<C-U>exe <SID>jump('pedit',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
32 nnoremap <silent><buffer> [d :<C-U>exe <SID>jump('pedit',v:count)<CR>
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
33 nnoremap <silent><buffer> ]d :<C-U>exe <SID>jump('pedit',v:count)<CR>
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-]>" .
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-D>" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
38 \ "|sil! nunmap <buffer> <C-W>]" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
39 \ "|sil! nunmap <buffer> <C-W><C-]>" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
40 \ "|sil! nunmap <buffer> <C-W>d" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
41 \ "|sil! nunmap <buffer> <C-W><C-D>" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
42 \ "|sil! nunmap <buffer> <C-W>}" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
43 \ "|sil! nunmap <buffer> [d" .
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
44 \ "|sil! nunmap <buffer> ]d"
2098
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
45 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
46
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
47 function! s:jump(command,count)
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
48 let steps = s:steps('.')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
49 if len(steps) == 0 || len(steps) < a:count
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
50 return 'echoerr "No matching step found"'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
51 elseif len(steps) > 1 && !a:count
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
52 return 'echoerr "Multiple matching steps found"'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
53 else
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
54 let c = a:count ? a:count-1 : 0
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
55 return a:command.' +'.steps[c][1].' '.escape(steps[c][0],' %#')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
56 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
57 endfunction
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
58
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
59 function! s:allsteps()
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
60 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
61 let steps = []
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
62 for file in split(glob(b:cucumber_root.'/**/*.rb'),"\n")
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
63 let lines = readfile(file)
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
64 let num = 0
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
65 for line in lines
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
66 let num += 1
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
67 if line =~ step_pattern
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
68 let type = matchstr(line,'\w\+')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
69 let steps += [[file,num,type,matchstr(line,step_pattern)]]
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
70 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
71 endfor
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
72 endfor
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
73 return steps
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
74 endfunction
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
75
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
76 function! s:steps(lnum)
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
77 let c = match(getline(a:lnum), '\S') + 1
2098
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
78 while synIDattr(synID(a:lnum,c,1),'name') !~# '^$\|Region$'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
79 let c = c + 1
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
80 endwhile
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
81 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
82 return filter(s:allsteps(),'s:stepmatch(v:val[3],step)')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
83 endfunction
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
84
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
85 function! s:stepmatch(receiver,target)
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
86 if a:receiver =~ '^[''"].*[''"]$'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
87 let pattern = '^'.escape(substitute(a:receiver[1:-2],'$\w\+','(.*)','g'),'/').'$'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
88 elseif a:receiver =~ '^/.*/$'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
89 let pattern = a:receiver[1:-2]
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
90 elseif a:receiver =~ '^%r..*.$'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
91 let pattern = escape(a:receiver[3:-2],'/')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
92 else
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
93 return 0
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
94 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
95 try
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
96 let vimpattern = substitute(substitute(pattern,'\\\@<!(?:','%(','g'),'\\\@<!\*?','{-}','g')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
97 if a:target =~# '\v'.vimpattern
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
98 return 1
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
99 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
100 catch
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
101 endtry
2526
713a4965ee7f Runtime file updates. (Tim Pope)
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
102 if has("ruby") && pattern !~ '\\\@<!#{'
2098
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
103 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
104 else
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
105 return 0
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
106 endif
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! s:bsub(target,pattern,replacement)
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
110 return substitute(a:target,'\C\\\@<!'.a:pattern,a:replacement,'g')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
111 endfunction
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
112
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
113 function! CucumberComplete(findstart,base) abort
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
114 let indent = indent('.')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
115 let group = synIDattr(synID(line('.'),indent+1,1),'name')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
116 let type = matchstr(group,'\Ccucumber\zs\%(Given\|When\|Then\)')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
117 let e = matchend(getline('.'),'^\s*\S\+\s')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
118 if type == '' || col('.') < col('$') || e < 0
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
119 return -1
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
120 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
121 if a:findstart
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
122 return e
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
123 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
124 let steps = []
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
125 for step in s:allsteps()
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
126 if step[2] ==# type
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
127 if step[3] =~ '^[''"]'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
128 let steps += [step[3][1:-2]]
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
129 elseif step[3] =~ '^/\^.*\$/$'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
130 let pattern = step[3][2:-3]
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
131 let pattern = substitute(pattern,'\C^(?:|I )','I ','')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
132 let pattern = s:bsub(pattern,'\\[Sw]','w')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
133 let pattern = s:bsub(pattern,'\\d','1')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
134 let pattern = s:bsub(pattern,'\\[sWD]',' ')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
135 let pattern = s:bsub(pattern,'\[\^\\\="\]','_')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
136 let pattern = s:bsub(pattern,'[[:alnum:]. _-][?*]?\=','')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
137 let pattern = s:bsub(pattern,'\[\([^^]\).\{-\}\]','\1')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
138 let pattern = s:bsub(pattern,'+?\=','')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
139 let pattern = s:bsub(pattern,'(\([[:alnum:]. -]\{-\}\))','\1')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
140 let pattern = s:bsub(pattern,'\\\([[:punct:]]\)','\1')
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
141 if pattern !~ '[\\()*?]'
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
142 let steps += [pattern]
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
143 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
144 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
145 endif
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
146 endfor
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
147 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
148 return sort(steps)
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
149 endfunction
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
150
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
151 let &cpo = s:keepcpo
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
152 unlet s:keepcpo
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2526
diff changeset
153
2098
3259c3923c1e Updated runtime an documentation files.
Bram Moolenaar <bram@zimbu.org>
parents:
diff changeset
154 " vim:set sts=2 sw=2: