# HG changeset patch # User Ludovic Chabant # Date 1487470851 28800 # Node ID 28d4dae03f2aa01ee5b85e6cca024e8def3eff02 # Parent 0f6605a9398bbbc2eb944c506f535c058849d656 If a user init function specified an absolute path, don't mess with it. diff -r 0f6605a9398b -r 28d4dae03f2a autoload/gutentags.vim --- a/autoload/gutentags.vim Fri Feb 17 20:39:36 2017 -0800 +++ b/autoload/gutentags.vim Sat Feb 18 18:20:51 2017 -0800 @@ -56,6 +56,17 @@ return g:gutentags_res_dir . a:filename endfunction +" 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] == ':' +endfunction +else +function! gutentags#is_path_rooted(path) abort + return !empty(a:path) && a:path[0] == '/' +endfunction +endif + " }}} " Gutentags Setup {{{ @@ -162,6 +173,9 @@ " Generate a path for a given filename in the cache directory. function! gutentags#get_cachefile(root_dir, filename) abort + if gutentags#is_path_rooted(a:filename) + return a:filename + endif let l:tag_path = gutentags#stripslash(a:root_dir) . '/' . a:filename if g:gutentags_cache_dir != "" " Put the tag file in the cache dir instead of inside the