Don't cache cwd

This commit is contained in:
Marco Hinz 2015-05-28 18:40:30 +02:00
parent a05b780c33
commit c0da740d7e
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,6 @@ function! sy#start() abort
if !exists('b:sy_info') if !exists('b:sy_info')
let b:sy_info = { let b:sy_info = {
\ 'chdir': haslocaldir() ? 'lcd' : 'cd', \ 'chdir': haslocaldir() ? 'lcd' : 'cd',
\ 'cwd': getcwd(),
\ 'dir': fnamemodify(b:sy_path, ':p:h'), \ 'dir': fnamemodify(b:sy_path, ':p:h'),
\ 'path': sy#util#escape(b:sy_path), \ 'path': sy#util#escape(b:sy_path),
\ 'file': sy#util#escape(fnamemodify(b:sy_path, ':t')), \ 'file': sy#util#escape(fnamemodify(b:sy_path, ':t')),

View File

@ -148,10 +148,11 @@ function! s:run(cmd, path, do_switch_dir)
if a:do_switch_dir if a:do_switch_dir
try try
let cwd = getcwd()
execute b:sy_info.chdir fnameescape(b:sy_info.dir) execute b:sy_info.chdir fnameescape(b:sy_info.dir)
let ret = system(cmd) let ret = system(cmd)
finally finally
execute b:sy_info.chdir fnameescape(b:sy_info.cwd) execute b:sy_info.chdir cwd
endtry endtry
return ret return ret
endif endif