Some minor updates and fixes

This commit is contained in:
Karl Yngve Lervåg 2015-02-27 12:12:48 +01:00
parent f42947311b
commit c5d00669f8
3 changed files with 9 additions and 19 deletions

View File

@ -104,7 +104,6 @@ function! s:init_environment() " {{{1
let b:latex.id = id let b:latex.id = id
else else
let data = {} let data = {}
let data.cmds = {}
let data.tex = main let data.tex = main
let data.root = fnamemodify(data.tex, ':h') let data.root = fnamemodify(data.tex, ':h')
let data.base = fnamemodify(data.tex, ':t') let data.base = fnamemodify(data.tex, ':t')

View File

@ -7,6 +7,7 @@
function! latex#latexmk#init(initialized) " {{{1 function! latex#latexmk#init(initialized) " {{{1
call latex#util#set_default('g:latex_latexmk_enabled', 1) call latex#util#set_default('g:latex_latexmk_enabled', 1)
if !g:latex_latexmk_enabled | return | endif if !g:latex_latexmk_enabled | return | endif
if s:system_incompatible() | return | endif
" Set default options " Set default options
call latex#util#set_default('g:latex_latexmk_background', 0) call latex#util#set_default('g:latex_latexmk_background', 0)
@ -22,16 +23,10 @@ function! latex#latexmk#init(initialized) " {{{1
call latex#util#error_deprecated('g:latex_latexmk_output') call latex#util#error_deprecated('g:latex_latexmk_output')
call latex#util#error_deprecated('g:latex_latexmk_quickfix') call latex#util#error_deprecated('g:latex_latexmk_quickfix')
" Check system compatibility
if s:system_incompatible() | return | endif
" Set compiler (this defines the errorformat) " Set compiler (this defines the errorformat)
compiler latexmk compiler latexmk
" Initialize pid for current tex file
if !has_key(g:latex#data[b:latex.id], 'pid')
let g:latex#data[b:latex.id].pid = 0 let g:latex#data[b:latex.id].pid = 0
endif
" Define commands " Define commands
command! -buffer VimLatexCompile call latex#latexmk#compile() command! -buffer VimLatexCompile call latex#latexmk#compile()
@ -115,18 +110,14 @@ function! latex#latexmk#clean(full) " {{{1
let cmd = 'cd ' . shellescape(data.root) . '; ' let cmd = 'cd ' . shellescape(data.root) . '; '
endif endif
let cmd .= 'latexmk -outdir=' . g:latex_latexmk_build_dir let cmd .= 'latexmk -outdir=' . g:latex_latexmk_build_dir
if a:full let cmd .= a:full ? ' -C ' : ' -c'
let cmd .= ' -C '
else
let cmd .= ' -c '
endif
let cmd .= latex#util#fnameescape(data.base) let cmd .= latex#util#fnameescape(data.base)
let g:latex#data[b:latex.id].cmds.clean = cmd
let exe = { let exe = {
\ 'cmd' : cmd, \ 'cmd' : cmd,
\ 'bg' : 0, \ 'bg' : 0,
\ } \ }
call latex#util#execute(exe) call latex#util#execute(exe)
let g:latex#data[b:latex.id].cmd_latexmk_clean = cmd
if a:full if a:full
echomsg "latexmk full clean finished" echomsg "latexmk full clean finished"
@ -395,7 +386,7 @@ function! s:latexmk_build_cmd(data) " {{{1
endif endif
let exe.cmd = cmd let exe.cmd = cmd
let a:data.cmds.compile = cmd let a:data.cmd_latexmk_compile = cmd
let a:data.tmp = tmp let a:data.tmp = tmp
return exe return exe

View File

@ -88,7 +88,7 @@ function! s:general.view() dict " {{{2
let exe.cmd .= ' ' . latex#util#fnameescape(outfile) let exe.cmd .= ' ' . latex#util#fnameescape(outfile)
call latex#util#execute(exe) call latex#util#execute(exe)
let g:latex#data[b:latex.id].cmds.view = exe.cmd let self.cmd_view = exe.cmd
endfunction endfunction
" }}}2 " }}}2
@ -260,7 +260,7 @@ function! s:okular.view() dict " {{{2
let exe.cmd .= '\#src:' . line('.') . latex#util#fnameescape(expand('%:p')) let exe.cmd .= '\#src:' . line('.') . latex#util#fnameescape(expand('%:p'))
call latex#util#execute(exe) call latex#util#execute(exe)
let g:latex#data[b:latex.id].cmds.view = exe.cmd let self.cmd_view = exe.cmd
endfunction endfunction
" }}}2 " }}}2
@ -288,7 +288,7 @@ function! s:qpdfview.view() dict " {{{2
let exe.cmd .= ':' . col('.') let exe.cmd .= ':' . col('.')
call latex#util#execute(exe) call latex#util#execute(exe)
let g:latex#data[b:latex.id].cmds.view = exe.cmd let self.cmd_view = exe.cmd
endfunction endfunction
" }}}2 " }}}2
@ -315,7 +315,7 @@ function! s:sumatrapdf.view() dict " {{{2
let exe.cmd .= ' ' . latex#util#fnameescape(outfile) let exe.cmd .= ' ' . latex#util#fnameescape(outfile)
call latex#util#execute(exe) call latex#util#execute(exe)
let g:latex#data[b:latex.id].cmds.view = exe.cmd let self.cmd_view = exe.cmd
endfunction endfunction
" }}}2 " }}}2