From c5d00669f8c86c81ead7307bc65c5593fa0397bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Fri, 27 Feb 2015 12:12:48 +0100 Subject: [PATCH] Some minor updates and fixes --- autoload/latex.vim | 1 - autoload/latex/latexmk.vim | 19 +++++-------------- autoload/latex/view.vim | 8 ++++---- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/autoload/latex.vim b/autoload/latex.vim index bedb404..9cea9ae 100644 --- a/autoload/latex.vim +++ b/autoload/latex.vim @@ -104,7 +104,6 @@ function! s:init_environment() " {{{1 let b:latex.id = id else let data = {} - let data.cmds = {} let data.tex = main let data.root = fnamemodify(data.tex, ':h') let data.base = fnamemodify(data.tex, ':t') diff --git a/autoload/latex/latexmk.vim b/autoload/latex/latexmk.vim index 8fa2b6d..6abe1d5 100644 --- a/autoload/latex/latexmk.vim +++ b/autoload/latex/latexmk.vim @@ -7,6 +7,7 @@ function! latex#latexmk#init(initialized) " {{{1 call latex#util#set_default('g:latex_latexmk_enabled', 1) if !g:latex_latexmk_enabled | return | endif + if s:system_incompatible() | return | endif " Set default options 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_quickfix') - " Check system compatibility - if s:system_incompatible() | return | endif - " Set compiler (this defines the errorformat) 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 - endif + let g:latex#data[b:latex.id].pid = 0 " Define commands command! -buffer VimLatexCompile call latex#latexmk#compile() @@ -115,18 +110,14 @@ function! latex#latexmk#clean(full) " {{{1 let cmd = 'cd ' . shellescape(data.root) . '; ' endif let cmd .= 'latexmk -outdir=' . g:latex_latexmk_build_dir - if a:full - let cmd .= ' -C ' - else - let cmd .= ' -c ' - endif + let cmd .= a:full ? ' -C ' : ' -c' let cmd .= latex#util#fnameescape(data.base) - let g:latex#data[b:latex.id].cmds.clean = cmd let exe = { \ 'cmd' : cmd, \ 'bg' : 0, \ } call latex#util#execute(exe) + let g:latex#data[b:latex.id].cmd_latexmk_clean = cmd if a:full echomsg "latexmk full clean finished" @@ -395,7 +386,7 @@ function! s:latexmk_build_cmd(data) " {{{1 endif let exe.cmd = cmd - let a:data.cmds.compile = cmd + let a:data.cmd_latexmk_compile = cmd let a:data.tmp = tmp return exe diff --git a/autoload/latex/view.vim b/autoload/latex/view.vim index 4b6ab4f..45dd335 100644 --- a/autoload/latex/view.vim +++ b/autoload/latex/view.vim @@ -88,7 +88,7 @@ function! s:general.view() dict " {{{2 let exe.cmd .= ' ' . latex#util#fnameescape(outfile) call latex#util#execute(exe) - let g:latex#data[b:latex.id].cmds.view = exe.cmd + let self.cmd_view = exe.cmd endfunction " }}}2 @@ -260,7 +260,7 @@ function! s:okular.view() dict " {{{2 let exe.cmd .= '\#src:' . line('.') . latex#util#fnameescape(expand('%:p')) call latex#util#execute(exe) - let g:latex#data[b:latex.id].cmds.view = exe.cmd + let self.cmd_view = exe.cmd endfunction " }}}2 @@ -288,7 +288,7 @@ function! s:qpdfview.view() dict " {{{2 let exe.cmd .= ':' . col('.') call latex#util#execute(exe) - let g:latex#data[b:latex.id].cmds.view = exe.cmd + let self.cmd_view = exe.cmd endfunction " }}}2 @@ -315,7 +315,7 @@ function! s:sumatrapdf.view() dict " {{{2 let exe.cmd .= ' ' . latex#util#fnameescape(outfile) call latex#util#execute(exe) - let g:latex#data[b:latex.id].cmds.view = exe.cmd + let self.cmd_view = exe.cmd endfunction " }}}2