Mercurial > vim-gutentags
changeset 123:76a4822aab76
Use existing b:gutentags_root
This could be set from g:gutentags_enabled_user_func then, for example.
author | Daniel Hahler <git@thequod.de> |
---|---|
date | Wed, 06 Apr 2016 18:05:39 +0200 |
parents | df3b0ca48013 |
children | e2a43c03da79 |
files | autoload/gutentags.vim doc/gutentags.txt |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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*