diff autoload/gutentags.vim @ 85:0424970d81f8

Add a `g:gutentags_resolve_symlinks` option to resolve symlinks at setup time.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 09 Oct 2015 15:28:39 -0700
parents 96bfe5c37f37
children afe113047204
line wrap: on
line diff
--- a/autoload/gutentags.vim	Wed Aug 26 22:21:19 2015 -0700
+++ b/autoload/gutentags.vim	Fri Oct 09 15:28:39 2015 -0700
@@ -110,7 +110,11 @@
     " Try and find what tags file we should manage.
     call gutentags#trace("Scanning buffer '" . bufname('%') . "' for gutentags setup...")
     try
-        let b:gutentags_root = gutentags#get_project_root(expand('%:p:h', 1))
+        let l:buf_dir = expand('%:p:h', 1)
+        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 filereadable(b:gutentags_root . '/.notags')
             call gutentags#trace("'notags' file found... no gutentags support.")
             return