changeset 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 efbe60d4865d
files autoload/gutentags/ctags.vim
diffstat 1 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Thu Feb 25 21:04:46 2016 -0800
+++ b/autoload/gutentags/ctags.vim	Thu Mar 10 14:49:55 2016 -0800
@@ -198,13 +198,27 @@
     let l:lines = readfile(a:path)
     let l:outlines = []
     for line in l:lines
-        let l:exarg = matchend(line, '\v^\-\-exclude=')
-        if l:exarg < 0
+        let l:exarg_idx = matchend(line, '\v^\-\-exclude=')
+        if l:exarg_idx < 0
             call add(l:outlines, line)
             continue
         endif
-        let l:fullp = gutentags#normalizepath(l:proj_dir.'/'.
-                    \strpart(line, l:exarg + 1))
+
+        " Don't convert things that don't look like paths.
+        let l:exarg = strpart(line, l:exarg_idx + 1)
+        let l:do_convert = 1
+        if l:exarg[0] == '@'   " Manifest file path
+            let l:do_convert = 0
+        endif
+        if stridx(l:exarg, '/') < 0 && stridx(l:exarg, '\\') < 0   " Filename
+            let l:do_convert = 0
+        endif
+        if l:do_convert == 0
+            call add(l:outlines, line)
+            continue
+        endif
+
+        let l:fullp = l:proj_dir . gutentags#normalizepath('/'.l:exarg)
         let l:ol = '--exclude='.l:fullp
         call add(l:outlines, l:ol)
     endfor