changeset 262:dc9216fc0c0f

escape the file name in a right way, handle `tcd` in vim
author skywind3000 <skywind3000@163.com>
date Fri, 14 Feb 2020 13:12:34 +0800
parents 0cc297329a6a
children d4b73a042976
files autoload/gutentags.vim
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/autoload/gutentags.vim	Fri Feb 14 22:30:23 2020 -0800
+++ b/autoload/gutentags.vim	Fri Feb 14 13:12:34 2020 +0800
@@ -6,9 +6,9 @@
     if has('nvim')
         let chdir = haslocaldir() ? 'lcd' : haslocaldir(-1, 0) ? 'tcd' : 'cd'
     else
-        let chdir = haslocaldir() ? 'lcd' : 'cd'
+        let chdir = haslocaldir() ? ((haslocaldir() == 1) ? 'lcd' : 'tcd') : 'cd'
     endif
-    execute chdir a:path
+    execute chdir fnameescape(a:path)
 endfunction
 
 " Throw an exception message.