diff --git a/autoload/latex.vim b/autoload/latex.vim index a48339e..ff7a381 100644 --- a/autoload/latex.vim +++ b/autoload/latex.vim @@ -88,7 +88,7 @@ endfunction " {{{1 latex#view function! latex#view() - let outfile = g:latex#data[b:latex.id].out() + let outfile = shellescape(g:latex#data[b:latex.id].out()) if !filereadable(outfile) echomsg "Can't view: Output file is not readable!" return @@ -118,10 +118,10 @@ function! s:init_environment() let b:latex.id = id else let data = {} - let data.tex = shellescape(main) - let data.root = shellescape(fnamemodify(data.tex, ':h')) - let data.base = shellescape(fnamemodify(data.tex, ':t')) - let data.name = shellescape(fnamemodify(data.tex, ':t:r')) + let data.tex = main + let data.root = fnamemodify(data.tex, ':h') + let data.base = fnamemodify(data.tex, ':t') + let data.name = fnamemodify(data.tex, ':t:r') function data.aux() dict return s:get_main_ext(self, 'aux') endfunction @@ -282,7 +282,7 @@ function! s:get_main_ext(texdata, ext) for f in map(candidates, \ 'a:texdata.root . ''/'' . v:val . ''.'' . a:ext') if filereadable(f) - return shellescape(fnamemodify(f, ':p')) + return fnamemodify(f, ':p') endif endfor diff --git a/autoload/latex/latexmk.vim b/autoload/latex/latexmk.vim index eee7b0f..855f73b 100644 --- a/autoload/latex/latexmk.vim +++ b/autoload/latex/latexmk.vim @@ -57,13 +57,13 @@ function! latex#latexmk#clean(...) " " Run latexmk clean process " - let cmd = '!cd ' . data.root . ';' + let cmd = '!cd ' . shellescape(data.root) . ';' if full let cmd .= 'latexmk -C ' else let cmd .= 'latexmk -c ' endif - let cmd .= data.base . ' &>/dev/null' + let cmd .= shellescape(data.base) . ' &>/dev/null' let g:latex#data[b:latex.id].clean_cmd = cmd call s:execute(cmd) @@ -85,7 +85,7 @@ function! latex#latexmk#compile() " " Set latexmk command with options " - let cmd = '!cd ' . data.root . ' && ' + let cmd = '!cd ' . shellescape(data.root) . ' && ' let cmd .= 'max_print_line=2000 latexmk' let cmd .= ' -' . g:latex_latexmk_output let cmd .= ' -quiet ' @@ -93,7 +93,7 @@ function! latex#latexmk#compile() let cmd .= ' ' . g:latex_latexmk_options let cmd .= ' -e ' . shellescape('$pdflatex =~ s/ / -file-line-error /') let cmd .= ' -e ' . shellescape('$latex =~ s/ / -file-line-error /') - let cmd .= ' ' . data.base + let cmd .= ' ' . shellescape(data.base) let cmd .= ' &>/dev/null &' let g:latex#data[b:latex.id].cmd = cmd