Improve VimtexClean; don't stop continuous compile

If continuous compilation is running, temporarily stop it while
doing a VimtexClean, then start it again.
This commit is contained in:
Karl Yngve Lervåg 2015-10-06 17:35:26 +02:00
parent bbcc68e9a4
commit 4af3a89f1c

View File

@ -85,6 +85,11 @@ endfunction
" }}}1 " }}}1
function! vimtex#latexmk#callback(status) " {{{1 function! vimtex#latexmk#callback(status) " {{{1
if get(s:, 'silence_next_callback', 0)
let s:silence_next_callback = 0
return
endif
call vimtex#latexmk#errors_open(0) call vimtex#latexmk#errors_open(0)
redraw! redraw!
@ -102,9 +107,9 @@ endfunction
" }}}1 " }}}1
function! vimtex#latexmk#clean(full) " {{{1 function! vimtex#latexmk#clean(full) " {{{1
if b:vimtex.pid if b:vimtex.pid
call vimtex#echo#status(['latexmk clean: ', silent call vimtex#latexmk#stop()
\ ['VimtexWarning', 'not while latexmk is running!']]) let l:restart = 1
return let s:silence_next_callback = 1
endif endif
" "
@ -124,6 +129,10 @@ function! vimtex#latexmk#clean(full) " {{{1
call vimtex#util#execute({'cmd' : cmd}) call vimtex#util#execute({'cmd' : cmd})
let b:vimtex.cmd_latexmk_clean = cmd let b:vimtex.cmd_latexmk_clean = cmd
if get(l:, 'restart', 0)
silent call vimtex#latexmk#compile()
endif
call vimtex#echo#status(['latexmk clean: ', call vimtex#echo#status(['latexmk clean: ',
\ ['VimtexSuccess', 'finished' . (a:full ? ' (full)' : '')]]) \ ['VimtexSuccess', 'finished' . (a:full ? ' (full)' : '')]])
endfunction endfunction
@ -391,6 +400,9 @@ function! s:latexmk_build_cmd() " {{{1
if g:vimtex_latexmk_continuous if g:vimtex_latexmk_continuous
let cmd .= ' -pvc' let cmd .= ' -pvc'
if get(s:, 'silence_next_callback', 0)
let cmd .= ' -view=none'
endif
endif endif
if g:vimtex_latexmk_callback && has('clientserver') if g:vimtex_latexmk_callback && has('clientserver')