# HG changeset patch # User Daniel Hahler # Date 1459958739 -7200 # Node ID 76a4822aab767e492c3c807545f1262a08e34828 # Parent df3b0ca480139292e5a6524d264889cc045d0a07 Use existing b:gutentags_root This could be set from g:gutentags_enabled_user_func then, for example. diff -r df3b0ca48013 -r 76a4822aab76 autoload/gutentags.vim --- a/autoload/gutentags.vim Fri Mar 25 20:41:38 2016 -0700 +++ b/autoload/gutentags.vim Wed Apr 06 18:05:39 2016 +0200 @@ -157,7 +157,9 @@ if g:gutentags_resolve_symlinks let l:buf_dir = fnamemodify(resolve(expand('%:p', 1)), ':p:h') endif - let b:gutentags_root = gutentags#get_project_root(l:buf_dir) + if !exists('b:gutentags_root') + let b:gutentags_root = gutentags#get_project_root(l:buf_dir) + endif if filereadable(b:gutentags_root . '/.notags') call gutentags#trace("'notags' file found... no gutentags support.") return diff -r df3b0ca48013 -r 76a4822aab76 doc/gutentags.txt --- a/doc/gutentags.txt Fri Mar 25 20:41:38 2016 -0700 +++ b/doc/gutentags.txt Wed Apr 06 18:05:39 2016 +0200 @@ -332,9 +332,11 @@ g:gutentags_enabled_user_func When set to a non-empty string, it is expected to be the name of a function that will be called when a file - is open in a project. The function gets passed the + is opened in a project. The function gets passed the path of the file and if it returns 0, Gutentags won't be enabled for that file. + You can use this also to manually set `b:gutentags_root` + (see |gutentags_project_root|). Defaults to "". *gutentags_define_advanced_commands*