Don't cache cwd
This commit is contained in:
parent
a05b780c33
commit
c0da740d7e
@ -27,7 +27,6 @@ function! sy#start() abort
|
||||
if !exists('b:sy_info')
|
||||
let b:sy_info = {
|
||||
\ 'chdir': haslocaldir() ? 'lcd' : 'cd',
|
||||
\ 'cwd': getcwd(),
|
||||
\ 'dir': fnamemodify(b:sy_path, ':p:h'),
|
||||
\ 'path': sy#util#escape(b:sy_path),
|
||||
\ 'file': sy#util#escape(fnamemodify(b:sy_path, ':t')),
|
||||
|
@ -148,10 +148,11 @@ function! s:run(cmd, path, do_switch_dir)
|
||||
|
||||
if a:do_switch_dir
|
||||
try
|
||||
let cwd = getcwd()
|
||||
execute b:sy_info.chdir fnameescape(b:sy_info.dir)
|
||||
let ret = system(cmd)
|
||||
finally
|
||||
execute b:sy_info.chdir fnameescape(b:sy_info.cwd)
|
||||
execute b:sy_info.chdir cwd
|
||||
endtry
|
||||
return ret
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user