[Vim-latex-cvs] vimfiles/ftplugin/latex-suite compiler.vim,1.63,1.64
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2004-05-18 22:23:22
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27477 Modified Files: compiler.vim Log Message: Bug: When the format dependency chain is interrupted in the middle, then the default target format is changed the next time we compile, i.e, if g:Tex_DefaultTargetFormat = 'ps' g:Tex_FormatDependency_ps = 'dvi,ps' and there is an error in the ->dvi step, then the next time, if the error is removed, Tex_RunLaTeX stops after the ->dvi step. Why: s:target is changed when Tex_RunLaTeX interrupts the build process. Fix: When there are errors and the build process needs to be interrupted, then reset the default target format. Index: compiler.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/compiler.vim,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** compiler.vim 16 May 2004 17:41:49 -0000 1.63 --- compiler.vim 18 May 2004 22:23:14 -0000 1.64 *************** *** 157,169 **** " create log file name from mainfname let mfnlog = fnamemodify(mainfname, ":t:r").'.log' ! call Tex_Debug('mfnlog = '.mfnlog, 'comp') " if we moved to a different window, then it means we had some errors. if winnum != winnr() ! call UpdatePreviewWindow(mfnlog) ! exe 'nnoremap <buffer> <silent> j j:call UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> k k:call UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> <up> <up>:call UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> <down> <down>:call UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> <enter> :call GotoErrorLocation("'.mfnlog.'")<CR>' setlocal nowrap --- 157,169 ---- " create log file name from mainfname let mfnlog = fnamemodify(mainfname, ":t:r").'.log' ! call Tex_Debug('Tex_SetupErrorWindow: mfnlog = '.mfnlog, 'comp') " if we moved to a different window, then it means we had some errors. if winnum != winnr() ! call Tex_UpdatePreviewWindow(mfnlog) ! exe 'nnoremap <buffer> <silent> j j:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> k k:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> <up> <up>:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> <down> <down>:call Tex_UpdatePreviewWindow("'.mfnlog.'")<CR>' ! exe 'nnoremap <buffer> <silent> <enter> :call Tex_GotoErrorLocation("'.mfnlog.'")<CR>' setlocal nowrap *************** *** 172,176 **** exec ( line('$') < 4 ? line('$') : 4 ).' wincmd _' if exists('g:Tex_GotoError') && g:Tex_GotoError == 1 ! call GotoErrorLocation(mfnlog) else exec s:origwinnum.' wincmd w' --- 172,176 ---- exec ( line('$') < 4 ? line('$') : 4 ).' wincmd _' if exists('g:Tex_GotoError') && g:Tex_GotoError == 1 ! call Tex_GotoErrorLocation(mfnlog) else exec s:origwinnum.' wincmd w' *************** *** 190,194 **** " Tex_RunLaTeX() is called. function! Tex_RunLaTeX() ! call Tex_Debug('getting to Tex_RunLaTeX, b:fragmentFile = '.exists('b:fragmentFile'), 'comp') let dir = expand("%:p:h").'/' --- 190,194 ---- " Tex_RunLaTeX() is called. function! Tex_RunLaTeX() ! call Tex_Debug('+Tex_RunLaTeX, b:fragmentFile = '.exists('b:fragmentFile'), 'comp') let dir = expand("%:p:h").'/' *************** *** 196,200 **** --- 196,204 ---- call Tex_CD(expand("%:p:h")) + let initTarget = s:target + " first get the dependency chain of this format. + call Tex_Debug("Tex_RunLaTeX: compiling to target [".s:target."]", "comp") + let dependency = s:target if exists('g:Tex_FormatDependency_'.s:target) *************** *** 206,210 **** endif ! call Tex_Debug('getting dependency chain = ['.dependency.']', 'comp') " now compile to the final target format via each dependency. --- 210,214 ---- endif ! call Tex_Debug('Tex_RunLaTeX: getting dependency chain = ['.dependency.']', 'comp') " now compile to the final target format via each dependency. *************** *** 212,223 **** while Tex_Strntok(dependency, ',', i) != '' let s:target = Tex_Strntok(dependency, ',', i) call Tex_SetTeXCompilerTarget('Compile', s:target) ! call Tex_Debug('setting target to '.s:target, 'comp') if g:Tex_MultipleCompileFormats =~ '\<'.s:target.'\>' ! call Tex_Debug("compiling file multiple times via Tex_CompileMultipleTimes", "comp") call Tex_CompileMultipleTimes() else ! call Tex_Debug("compiling file once via Tex_CompileLatex", "comp") call Tex_CompileLatex() endif --- 216,228 ---- while Tex_Strntok(dependency, ',', i) != '' let s:target = Tex_Strntok(dependency, ',', i) + call Tex_SetTeXCompilerTarget('Compile', s:target) ! call Tex_Debug('Tex_RunLaTeX: setting target to '.s:target, 'comp') if g:Tex_MultipleCompileFormats =~ '\<'.s:target.'\>' ! call Tex_Debug("Tex_RunLaTeX: compiling file multiple times via Tex_CompileMultipleTimes", "comp") call Tex_CompileMultipleTimes() else ! call Tex_Debug("Tex_RunLaTeX: compiling file once via Tex_CompileLatex", "comp") call Tex_CompileLatex() endif *************** *** 228,232 **** " If there are any errors, then break from the rest of the steps if errlist =~ '\v(error|warning)' ! call Tex_Debug('There were errors in compiling, breaking chain...', 'comp') break endif --- 233,237 ---- " If there are any errors, then break from the rest of the steps if errlist =~ '\v(error|warning)' ! call Tex_Debug('Tex_RunLaTeX: There were errors in compiling, breaking chain...', 'comp') break endif *************** *** 235,242 **** --- 240,249 ---- endwhile + let s:target = initTarget let s:origwinnum = winnr() call Tex_SetupErrorWindow() call Tex_CD(curd) + call Tex_Debug("-Tex_RunLaTeX", "comp") endfunction *************** *** 545,548 **** --- 552,556 ---- if biblinesAfter != biblinesBefore echomsg 'Need to rerun because bibliography file changed...' + call Tex_Debug('Tex_CompileMultipleTimes: Need to rerun because bibliography file changed...', 'comp') let needToRerun = 1 endif *************** *** 552,555 **** --- 560,564 ---- if Tex_IsPresentInFile('Rerun to get cross-references right', mainFileName_root.'.log') echomsg "Need to rerun to get cross-references right..." + call Tex_Debug("Tex_CompileMultipleTimes: Need to rerun to get cross-references right...", 'comp') let needToRerun = 1 endif *************** *** 558,561 **** --- 567,571 ---- endwhile + call Tex_Debug("Tex_CompileMultipleTimes: Ran latex ".runCount." time(s)", "comp") echomsg "Ran latex ".runCount." time(s)" *************** *** 577,581 **** " window. " ============================================================================== ! " PositionPreviewWindow: positions the preview window correctly. {{{ " Description: " The purpose of this function is to count the number of times an error --- 587,591 ---- " window. " ============================================================================== ! " Tex_PositionPreviewWindow: positions the preview window correctly. {{{ " Description: " The purpose of this function is to count the number of times an error *************** *** 585,589 **** " like |10 error|. " ! function! PositionPreviewWindow(filename) if getline('.') !~ '|\d\+ \(error\|warning\)|' --- 595,599 ---- " like |10 error|. " ! function! Tex_PositionPreviewWindow(filename) if getline('.') !~ '|\d\+ \(error\|warning\)|' *************** *** 665,669 **** endfunction " }}} ! " UpdatePreviewWindow: updates the view of the log file {{{ " Description: " This function should be called when focus is in a quickfix window. --- 675,679 ---- endfunction " }}} ! " Tex_UpdatePreviewWindow: updates the view of the log file {{{ " Description: " This function should be called when focus is in a quickfix window. *************** *** 673,678 **** " window when the function returns. " ! function! UpdatePreviewWindow(filename) ! call PositionPreviewWindow(a:filename) if &previewwindow --- 683,688 ---- " window when the function returns. " ! function! Tex_UpdatePreviewWindow(filename) ! call Tex_PositionPreviewWindow(a:filename) if &previewwindow *************** *** 681,685 **** endif endfunction " }}} ! " GotoErrorLocation: goes to the correct location of error in the tex file {{{ " Description: " This function should be called when focus is in a quickfix window. This --- 691,695 ---- endif endfunction " }}} ! " Tex_GotoErrorLocation: goes to the correct location of error in the tex file {{{ " Description: " This function should be called when focus is in a quickfix window. This *************** *** 690,694 **** " " The position is both the correct line number and the column number. ! function! GotoErrorLocation(filename) " first use vim's functionality to take us to the location of the error --- 700,704 ---- " " The position is both the correct line number and the column number. ! function! Tex_GotoErrorLocation(filename) " first use vim's functionality to take us to the location of the error *************** *** 708,712 **** " find out where in the file we had the error. let linenum = matchstr(getline('.'), '|\zs\d\+\ze \(warning\|error\)|') ! call PositionPreviewWindow(a:filename) if getline('.') =~ 'l.\d\+' --- 718,722 ---- " find out where in the file we had the error. let linenum = matchstr(getline('.'), '|\zs\d\+\ze \(warning\|error\)|') ! call Tex_PositionPreviewWindow(a:filename) if getline('.') =~ 'l.\d\+' *************** *** 743,749 **** endfunction " }}} ! " SetCompilerMaps: sets maps for compiling/viewing/searching {{{ " Description: ! function! <SID>SetCompilerMaps() if exists('b:Tex_doneCompilerMaps') return --- 753,759 ---- endfunction " }}} ! " Tex_SetCompilerMaps: sets maps for compiling/viewing/searching {{{ " Description: ! function! <SID>Tex_SetCompilerMaps() if exists('b:Tex_doneCompilerMaps') return *************** *** 766,770 **** au LatexSuite User LatexSuiteFileType \ call Tex_Debug('compiler.vim: Catching LatexSuiteFileType event', 'comp') | ! \ call <SID>SetCompilerMaps() augroup END --- 776,780 ---- au LatexSuite User LatexSuiteFileType \ call Tex_Debug('compiler.vim: Catching LatexSuiteFileType event', 'comp') | ! \ call <SID>Tex_SetCompilerMaps() augroup END |