comparison autoload/gutentags/ctags.vim @ 169:95afd985a4c3

Merge pull request #97 from GitHub.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 19 Feb 2017 20:00:13 -0800
parents 34c57ad6eb45 e59321cbaff7
children 18df731b1563
comparison
equal deleted inserted replaced
167:34c57ad6eb45 169:95afd985a4c3
89 " root, some `ctags` implementations like Exhuberant Ctags can get 89 " root, some `ctags` implementations like Exhuberant Ctags can get
90 " confused if the paths have spaces -- but not if you're *in* the root 90 " confused if the paths have spaces -- but not if you're *in* the root
91 " directory, for some reason... 91 " directory, for some reason...
92 let l:actual_proj_dir = '.' 92 let l:actual_proj_dir = '.'
93 let l:actual_tags_file = fnamemodify(a:tags_file, ':.') 93 let l:actual_tags_file = fnamemodify(a:tags_file, ':.')
94 call gutentags#chdir(fnameescape(a:proj_dir))
94 else 95 else
95 " else: the tags file goes in a cache directory, so we need to specify 96 " else: the tags file goes in a cache directory, so we need to specify
96 " all the paths absolutely for `ctags` to do its job correctly. 97 " all the paths absolutely for `ctags` to do its job correctly.
97 let l:actual_proj_dir = a:proj_dir 98 let l:actual_proj_dir = a:proj_dir
98 let l:actual_tags_file = a:tags_file 99 let l:actual_tags_file = a:tags_file
166 endif 167 endif
167 endif 168 endif
168 let l:cmd .= gutentags#get_execute_cmd_suffix() 169 let l:cmd .= gutentags#get_execute_cmd_suffix()
169 170
170 call gutentags#trace("Running: " . l:cmd) 171 call gutentags#trace("Running: " . l:cmd)
171 call gutentags#trace("In: " . getcwd()) 172 call gutentags#trace("In: " . gutentags#pwd())
172 if !g:gutentags_fake 173 if !g:gutentags_fake
173 " Run the background process. 174 " Run the background process.
174 if !g:gutentags_trace 175 if !g:gutentags_trace
175 silent execute l:cmd 176 silent execute l:cmd
176 else 177 else
184 call gutentags#trace("(fake... not actually running)") 185 call gutentags#trace("(fake... not actually running)")
185 endif 186 endif
186 call gutentags#trace("") 187 call gutentags#trace("")
187 finally 188 finally
188 " Restore the previous working directory. 189 " Restore the previous working directory.
189 execute "chdir " . fnameescape(l:prev_cwd) 190 call gutentags#chdir(fnameescape(l:prev_cwd))
190 endtry 191 endtry
191 endfunction 192 endfunction
192 193
193 " }}} 194 " }}}
194 195