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')
|
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')),
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user