comparison autoload/gutentags/ctags.vim @ 99:05fc1e2172cc

Fixes in the processing of `.gutctags`. * Don't normalize the project path, as the current Vim could be on win32 with `shellslash` enabled. * Don't try to turn simple filenames or patterns into absolute paths.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 10 Mar 2016 14:49:55 -0800
parents d645125192aa
children df3b0ca48013
comparison
equal deleted inserted replaced
98:d645125192aa 99:05fc1e2172cc
196 " matching with absolute paths too, so the exclude rules need to be 196 " matching with absolute paths too, so the exclude rules need to be
197 " absolute. 197 " absolute.
198 let l:lines = readfile(a:path) 198 let l:lines = readfile(a:path)
199 let l:outlines = [] 199 let l:outlines = []
200 for line in l:lines 200 for line in l:lines
201 let l:exarg = matchend(line, '\v^\-\-exclude=') 201 let l:exarg_idx = matchend(line, '\v^\-\-exclude=')
202 if l:exarg < 0 202 if l:exarg_idx < 0
203 call add(l:outlines, line) 203 call add(l:outlines, line)
204 continue 204 continue
205 endif 205 endif
206 let l:fullp = gutentags#normalizepath(l:proj_dir.'/'. 206
207 \strpart(line, l:exarg + 1)) 207 " Don't convert things that don't look like paths.
208 let l:exarg = strpart(line, l:exarg_idx + 1)
209 let l:do_convert = 1
210 if l:exarg[0] == '@' " Manifest file path
211 let l:do_convert = 0
212 endif
213 if stridx(l:exarg, '/') < 0 && stridx(l:exarg, '\\') < 0 " Filename
214 let l:do_convert = 0
215 endif
216 if l:do_convert == 0
217 call add(l:outlines, line)
218 continue
219 endif
220
221 let l:fullp = l:proj_dir . gutentags#normalizepath('/'.l:exarg)
208 let l:ol = '--exclude='.l:fullp 222 let l:ol = '--exclude='.l:fullp
209 call add(l:outlines, l:ol) 223 call add(l:outlines, l:ol)
210 endfor 224 endfor
211 225
212 call writefile(l:outlines, l:out_path) 226 call writefile(l:outlines, l:out_path)