# HG changeset patch # User Ludovic Chabant # Date 1487709405 28800 # Node ID 2cf3fb66285b818eae0be7d5ddd08d27c43f27b5 # Parent 02a94ff0db5771ac410577a7a6a6a761d6d23a60 Use absolute paths for `ctags` if the tags file is not local. diff -r 02a94ff0db57 -r 2cf3fb66285b autoload/gutentags.vim --- a/autoload/gutentags.vim Sun Feb 19 20:47:50 2017 -0800 +++ b/autoload/gutentags.vim Tue Feb 21 12:36:45 2017 -0800 @@ -76,7 +76,8 @@ " Returns whether a path is rooted. if has('win32') || has('win64') function! gutentags#is_path_rooted(path) abort - return len(a:path) >= 2 && a:path[1] == ':' + return len(a:path) >= 2 && ( + \a:path[0] == '/' || a:path[0] == '\' || a:path[1] == ':') endfunction else function! gutentags#is_path_rooted(path) abort diff -r 02a94ff0db57 -r 2cf3fb66285b autoload/gutentags/ctags.vim --- a/autoload/gutentags/ctags.vim Sun Feb 19 20:47:50 2017 -0800 +++ b/autoload/gutentags/ctags.vim Tue Feb 21 12:36:45 2017 -0800 @@ -69,6 +69,7 @@ execute "chdir " . fnameescape(a:proj_dir) let l:tags_file_exists = filereadable(a:tags_file) + let l:tags_file_is_local = match(a:tags_file, '\v[/\\]') < 0 if l:tags_file_exists && g:gutentags_ctags_check_tagfile let l:first_lines = readfile(a:tags_file, '', 1) @@ -81,7 +82,7 @@ endif endif - if empty(g:gutentags_cache_dir) + if empty(g:gutentags_cache_dir) && l:tags_file_is_local " If we don't use the cache directory, we can pass relative paths " around. " @@ -107,7 +108,7 @@ let l:cmd .= ' -p "' . l:actual_proj_dir . '"' if a:write_mode == 0 && l:tags_file_exists let l:cur_file_path = expand('%:p') - if empty(g:gutentags_cache_dir) + if empty(g:gutentags_cache_dir) && l:tags_file_is_local let l:cur_file_path = fnamemodify(l:cur_file_path, ':.') endif let l:cmd .= ' -s "' . l:cur_file_path . '"'