comparison autoload/gutentags.vim @ 122:3763e9f412e7

Merge pull request #78 from GitHub.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 13 Jun 2016 18:44:29 -0700
parents 2838af9ff980 8310e4602de9
children e2a43c03da79
comparison
equal deleted inserted replaced
120:5776acb079cf 122:3763e9f412e7
126 " Generate a path for a given filename in the cache directory. 126 " Generate a path for a given filename in the cache directory.
127 function! gutentags#get_cachefile(root_dir, filename) abort 127 function! gutentags#get_cachefile(root_dir, filename) abort
128 let l:tag_path = gutentags#stripslash(a:root_dir) . '/' . a:filename 128 let l:tag_path = gutentags#stripslash(a:root_dir) . '/' . a:filename
129 if g:gutentags_cache_dir != "" 129 if g:gutentags_cache_dir != ""
130 " Put the tag file in the cache dir instead of inside the 130 " Put the tag file in the cache dir instead of inside the
131 " projet root. 131 " project root.
132 let l:tag_path = g:gutentags_cache_dir . '/' . 132 let l:tag_path = g:gutentags_cache_dir . '/' .
133 \tr(l:tag_path, '\/: ', '---_') 133 \tr(l:tag_path, '\/: ', '---_')
134 let l:tag_path = substitute(l:tag_path, '/\-', '/', '') 134 let l:tag_path = substitute(l:tag_path, '/\-', '/', '')
135 endif 135 endif
136 let l:tag_path = gutentags#normalizepath(l:tag_path) 136 let l:tag_path = gutentags#normalizepath(l:tag_path)
166 if g:gutentags_resolve_symlinks 166 if g:gutentags_resolve_symlinks
167 let l:buf_dir = fnamemodify(resolve(expand('%:p', 1)), ':p:h') 167 let l:buf_dir = fnamemodify(resolve(expand('%:p', 1)), ':p:h')
168 endif 168 endif
169 let b:gutentags_root = gutentags#get_project_root(l:buf_dir) 169 let b:gutentags_root = gutentags#get_project_root(l:buf_dir)
170 if filereadable(b:gutentags_root . '/.notags') 170 if filereadable(b:gutentags_root . '/.notags')
171 call gutentags#trace("'notags' file found... no gutentags support.") 171 call gutentags#trace("'.notags' file found... no gutentags support.")
172 return 172 return
173 endif 173 endif
174 174
175 if !has_key(s:known_projects, b:gutentags_root) 175 if !has_key(s:known_projects, b:gutentags_root)
176 call s:cache_project_root(b:gutentags_root) 176 call s:cache_project_root(b:gutentags_root)
192 call gutentags#trace("No gutentags support for this buffer.") 192 call gutentags#trace("No gutentags support for this buffer.")
193 return 193 return
194 endtry 194 endtry
195 195
196 " We know what tags file to manage! Now set things up. 196 " We know what tags file to manage! Now set things up.
197 call gutentags#trace("Setting gutentags for buffer '" . bufname('%')) 197 call gutentags#trace("Setting gutentags for buffer '".bufname('%')."'")
198 198
199 " Autocommands for updating the tags on save. 199 " Autocommands for updating the tags on save.
200 let l:bn = bufnr('%') 200 let l:bn = bufnr('%')
201 execute 'augroup gutentags_buffer_' . l:bn 201 execute 'augroup gutentags_buffer_' . l:bn
202 execute ' autocmd!' 202 execute ' autocmd!'