changeset 112:563fbba43288

Merge pull request #63 from GitHub.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 25 Mar 2016 19:32:31 -0700
parents efbe60d4865d (diff) f9f0f45d2bdb (current diff)
children df3b0ca48013
files
diffstat 2 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags.vim	Mon Feb 22 06:54:07 2016 +0300
+++ b/autoload/gutentags.vim	Fri Mar 25 19:32:31 2016 -0700
@@ -262,6 +262,7 @@
     for module in g:gutentags_modules
         call s:update_tags(module, a:bang, 0)
     endfor
+    silent doautocmd User GutentagsUpdated
 endfunction
 
 " (Re)Generate the tags file for a buffer that just go saved.
@@ -271,6 +272,7 @@
             call s:update_tags(module, 0, 2)
         endfor
     endif
+    silent doautocmd User GutentagsUpdated
 endfunction
 
 " Update the tags file for the current buffer's file.
--- a/autoload/gutentags/ctags.vim	Mon Feb 22 06:54:07 2016 +0300
+++ b/autoload/gutentags/ctags.vim	Fri Mar 25 19:32:31 2016 -0700
@@ -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