diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index e48c8062bb..8bc0dbf017 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -307,10 +307,10 @@ fun! tar#Read(fname,mode) " attempt to change to the indicated directory try - exe "cd ".fnameescape(tmpdir) + exe "lcd ".fnameescape(tmpdir) catch /^Vim\%((\a\+)\)\=:E344/ redraw! - echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None + echohl Error | echo "***error*** (tar#Write) cannot lcd to temporary directory" | Echohl None let &report= repkeep return endtry @@ -320,7 +320,7 @@ fun! tar#Read(fname,mode) call s:Rmdir("_ZIPVIM_") endif call mkdir("_ZIPVIM_") - cd _ZIPVIM_ + lcd _ZIPVIM_ if has("win32unix") && executable("cygpath") " assuming cygwin @@ -418,9 +418,9 @@ fun! tar#Read(fname,mode) redraw! if v:shell_error != 0 - cd .. + lcd .. call s:Rmdir("_ZIPVIM_") - exe "cd ".fnameescape(curdir) + exe "lcd ".fnameescape(curdir) echohl Error | echo "***error*** (tar#Read) sorry, unable to open or extract ".tarfile." with ".fname | echohl None endif @@ -437,14 +437,16 @@ if v:shell_error != 0 set nomod let &report= repkeep + exe "lcd ".fnameescape(curdir) + silent exe "file tarfile::".escape_file endfun " --------------------------------------------------------------------- " tar#Write: {{{2 fun! tar#Write(fname) + let pwdkeep= getcwd() let repkeep= &report set report=10 - " temporary buffer variable workaround because too fucking tired. but it works now let curdir= b:curdir let tmpdir= b:tmpdir @@ -567,9 +569,9 @@ fun! tar#Write(fname) endif " cleanup and restore current directory - cd .. + lcd .. call s:Rmdir("_ZIPVIM_") - exe "cd ".fnameescape(curdir) + exe "lcd ".fnameescape(pwdkeep) setlocal nomod let &report= repkeep