changeset 133:6f15299869fc

Don't pass absolute paths to `ctags` when we want relative paths from it.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 20 Jul 2016 13:43:41 +0200
parents a6ef1c860d07
children 04288637e595
files autoload/gutentags/ctags.vim
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags/ctags.vim	Wed Jul 20 12:22:51 2016 +0200
+++ b/autoload/gutentags/ctags.vim	Wed Jul 20 13:43:41 2016 +0200
@@ -74,8 +74,11 @@
         let l:cmd .= ' -t "' . l:actual_tags_file . '"'
         let l:cmd .= ' -p "' . l:actual_proj_dir . '"'
         if a:write_mode == 0 && l:tags_file_exists
-            let l:full_path = expand('%:p')
-            let l:cmd .= ' -s "' . l:full_path . '"'
+            let l:cur_file_path = expand('%:p')
+            if empty(g:gutentags_cache_dir)
+                let l:cur_file_path = fnamemodify(l:cur_file_path, ':.')
+            endif
+            let l:cmd .= ' -s "' . l:cur_file_path . '"'
         endif
         " Pass the Gutentags options file first, and then the project specific
         " one, so that users can override the default behaviour.