diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2014-07-29 13:03:49 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2014-07-29 13:03:49 +0200 |
commit | 5f1223fbc5285689db812236c9100329740a805b (patch) | |
tree | 58bc6f11540011afb25826c96f65fa35f5687291 /ftplugin/latex-box/latexmk.vim | |
parent | a59f644d49ee029df48586a6c3c358858f1e6739 (diff) | |
download | vim-polyglot-1.9.2.tar.gz vim-polyglot-1.9.2.zip |
Major updatev1.9.2
Diffstat (limited to '')
-rw-r--r-- | ftplugin/latex-box/latexmk.vim | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/ftplugin/latex-box/latexmk.vim b/ftplugin/latex-box/latexmk.vim index dfa55f0e..bb70f83d 100644 --- a/ftplugin/latex-box/latexmk.vim +++ b/ftplugin/latex-box/latexmk.vim @@ -413,23 +413,38 @@ function! LatexBox_LatexErrors(status, ...) if a:status < 0 botright copen else - " Write status message to screen - redraw - if a:status > 0 || len(getqflist())>1 - echomsg 'Compiling to ' . g:LatexBox_output_type . ' ... failed!' - else - echomsg 'Compiling to ' . g:LatexBox_output_type . ' ... success!' - endif - " Only open window when an error/warning is detected - if g:LatexBox_quickfix + if g:LatexBox_quickfix >= 3 + \ ? s:log_contains_error(log) + \ : g:LatexBox_quickfix > 0 belowright cw - if g:LatexBox_quickfix==2 + if g:LatexBox_quickfix == 2 || g:LatexBox_quickfix == 4 wincmd p endif endif + redraw + + " Write status message to screen + if a:status > 0 || len(getqflist())>1 + if s:log_contains_error(log) + let l:status_msg = ' ... failed!' + else + let l:status_msg = ' ... there were warnings!' + endif + else + let l:status_msg = ' ... success!' + endif + echomsg 'Compiling to ' . g:LatexBox_output_type . l:status_msg endif endfunction + +function! s:log_contains_error(file) + let lines = readfile(a:file) + let lines = filter(lines, 'v:val =~ ''^.*:\d\+: ''') + let lines = uniq(map(lines, 'matchstr(v:val, ''^.*\ze:\d\+:'')')) + let lines = filter(lines, 'filereadable(fnameescape(v:val))') + return len(lines) > 0 +endfunction " }}} " LatexmkStatus {{{ |