Allow arguments for latex#view (fixes #23)

This commit is contained in:
Karl Yngve Lervåg 2014-07-13 00:27:43 +02:00
parent d4a5d856a3
commit ef194e82a6

View File

@ -87,15 +87,19 @@ function! latex#reinit()
endfunction
" {{{1 latex#view
function! latex#view()
function! latex#view(...)
let outfile = g:latex#data[b:latex.id].out()
if !filereadable(outfile)
echomsg "Can't view: Output file is not readable!"
return
endif
" Join arguments to pass them on to the viewer
let args = join(a:000, ' ')
let exe = {}
let exe.cmd = g:latex_viewer . ' ' . shellescape(outfile)
let exe.cmd = g:latex_viewer . ' ' . args . shellescape(outfile)
call latex#util#execute(exe)
endfunction
" }}}1