# HG changeset patch # User Ludovic Chabant # Date 1487483872 28800 # Node ID 34c57ad6eb451a14dde71f31ed34e9b68253197e # Parent 1fe62e7f1faedb5f05a48f38ea3859204183d192 Always use the potentially custom name for the tags file. If the tags file got a custom name from `gutentags_init_user_func`, we need to use that in all situations. However, the tags file name we get in the `generate` function is a full path so we make it relative to the project root if possible when we don't use a cache directory for tags files. diff -r 1fe62e7f1fae -r 34c57ad6eb45 autoload/gutentags/ctags.vim --- a/autoload/gutentags/ctags.vim Sat Feb 18 21:45:39 2017 -0800 +++ b/autoload/gutentags/ctags.vim Sat Feb 18 21:57:52 2017 -0800 @@ -82,14 +82,15 @@ endif if empty(g:gutentags_cache_dir) - " If we don't use the cache directory, let's just use the tag filename - " as specified by the user, since it's relative to the project root, - " and we are already `chdir`'d into it. - " Note that if we don't do this and pass a full path, `ctags` gets - " confused if the paths have spaces -- but not if you're *in* the - " root directory. + " If we don't use the cache directory, we can pass relative paths + " around. + " + " Note that if we don't do this and pass a full path for the project + " root, some `ctags` implementations like Exhuberant Ctags can get + " confused if the paths have spaces -- but not if you're *in* the root + " directory, for some reason... let l:actual_proj_dir = '.' - let l:actual_tags_file = g:gutentags_ctags_tagfile + let l:actual_tags_file = fnamemodify(a:tags_file, ':.') else " else: the tags file goes in a cache directory, so we need to specify " all the paths absolutely for `ctags` to do its job correctly.