Skip to content

Commit

Permalink
Some minor updates and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lervag committed Feb 27, 2015
1 parent f429473 commit c5d0066
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
1 change: 0 additions & 1 deletion autoload/latex.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
19 changes: 5 additions & 14 deletions autoload/latex/latexmk.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions autoload/latex/view.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c5d0066

Please sign in to comment.