changeset 180:8bac4b955c84

Merge pull request #117 from GitHub.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 23 Mar 2017 16:00:24 -0700
parents 3d7f2bf017fd (current diff) 411f3fa915f5 (diff)
children 0b4ccd0deceb
files autoload/gutentags.vim
diffstat 4 files changed, 6 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags.vim	Sat Mar 11 21:50:00 2017 -0800
+++ b/autoload/gutentags.vim	Thu Mar 23 16:00:24 2017 -0700
@@ -2,14 +2,6 @@
 
 " Utilities {{{
 
-function! gutentags#pwd()
-  if has('nvim')
-    return haslocaldir() ? getcwd(0, 0) : haslocaldir(-1, 0) ? getcwd(-1, 0) : getcwd()
-  else
-    return haslocaldir() ? getcwd(0, 0) : getcwd()
-  endif
-endfunction
-
 function! gutentags#chdir(path)
   if has('nvim')
     let chdir = haslocaldir() ? 'lcd' : haslocaldir(-1, 0) ? 'tcd' : 'cd'
@@ -402,7 +394,7 @@
     " Switch to the project root to make the command line smaller, and make
     " it possible to get the relative path of the filename to parse if we're
     " doing an incremental update.
-    let l:prev_cwd = gutentags#pwd()
+    let l:prev_cwd = getcwd()
     call gutentags#chdir(fnameescape(l:proj_dir))
     try
         call call("gutentags#".a:module."#generate",
--- a/autoload/gutentags/cscope.vim	Sat Mar 11 21:50:00 2017 -0800
+++ b/autoload/gutentags/cscope.vim	Thu Mar 23 16:00:24 2017 -0700
@@ -64,7 +64,7 @@
     let l:cmd .= gutentags#get_execute_cmd_suffix()
 
     call gutentags#trace("Running: " . l:cmd)
-    call gutentags#trace("In:      " . gutentags#pwd())
+    call gutentags#trace("In:      " . getcwd())
     if !g:gutentags_fake
         if !(has('nvim') && exists('*jobwait'))
             if !g:gutentags_trace
--- a/autoload/gutentags/ctags.vim	Sat Mar 11 21:50:00 2017 -0800
+++ b/autoload/gutentags/ctags.vim	Thu Mar 23 16:00:24 2017 -0700
@@ -66,7 +66,7 @@
     " Get to the tags file directory because ctags is finicky about
     " these things.
     let l:prev_cwd = getcwd()
-    execute "chdir " . fnameescape(a:proj_dir)
+    call gutentags#chdir(fnameescape(a:proj_dir))
 
     let l:tags_file_exists = filereadable(a:tags_file)
     let l:tags_file_is_local = match(a:tags_file, '\v[/\\]') < 0
@@ -170,7 +170,7 @@
         let l:cmd .= gutentags#get_execute_cmd_suffix()
 
         call gutentags#trace("Running: " . l:cmd)
-        call gutentags#trace("In:      " . gutentags#pwd())
+        call gutentags#trace("In:      " . getcwd())
         if !g:gutentags_fake
             " Run the background process.
             if !g:gutentags_trace
--- a/autoload/gutentags/gtags_cscope.vim	Sat Mar 11 21:50:00 2017 -0800
+++ b/autoload/gutentags/gtags_cscope.vim	Thu Mar 23 16:00:24 2017 -0700
@@ -151,7 +151,7 @@
 	let l:use_jobs = has('job')
 
 	let l:prev_cwd = getcwd()
-	execute "chdir " . fnameescape(a:proj_dir)
+	call gutentags#chdir(fnameescape(a:proj_dir))
 	try
 		if has('win32')
 			let l:cmd = s:get_win32_cmd(l:use_jobs, l:proj_options, l:db_path)
@@ -189,7 +189,7 @@
 		call gutentags#trace("")
     finally
         " Restore the previous working directory.
-        execute "chdir " . fnameescape(l:prev_cwd)
+        call gutentags#chdir(fnameescape(l:prev_cwd))
     endtry
 endfunction