diff --git a/autoload/latex/complete.vim b/autoload/latex/complete.vim index 4b503bf..cddb572 100644 --- a/autoload/latex/complete.vim +++ b/autoload/latex/complete.vim @@ -160,7 +160,7 @@ function! s:bibtex_search(regexp) " {{{2 " The bibtex completion seems to require that we are in the project root let l:save_pwd = getcwd() - execute 'lcd ' . g:latex#data[b:latex.id].root + execute 'lcd ' . fnameescape(g:latex#data[b:latex.id].root) " Find data from external bib files let bibfiles = join(s:bibtex_find_bibs(), ',') @@ -211,7 +211,7 @@ function! s:bibtex_search(regexp) " {{{2 endif " Return to previous working directory - execute 'lcd ' . l:save_pwd + execute 'lcd ' . fnameescape(l:save_pwd) " Find data from 'thebibliography' environments let lines = readfile(g:latex#data[b:latex.id].tex) diff --git a/autoload/latex/util.vim b/autoload/latex/util.vim index 50f4c4d..07cc723 100644 --- a/autoload/latex/util.vim +++ b/autoload/latex/util.vim @@ -119,7 +119,7 @@ function! latex#util#execute(exe) " {{{1 " Change directory if wanted if has_key(a:exe, 'wd') let pwd = getcwd() - execute 'lcd ' . a:exe.wd + execute 'lcd ' . fnameescape(a:exe.wd) endif " Set up command string based on the given system @@ -151,7 +151,7 @@ function! latex#util#execute(exe) " {{{1 " Return to previous working directory if has_key(a:exe, 'wd') - execute 'lcd ' . pwd + execute 'lcd ' . fnameescape(pwd) endif if !has("gui_running")