Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv18220
Modified Files:
compiler.vim
Log Message:
Account for more than one error on the same line.
TODO:
When a latex error occurs far away from the beginning of a line, as
This is a long line which is quite long really and here is the $\errorthingie$
Then the corresponding line in the log file might look like
l.26 .... here is the $\errorthingie$.
Which causes a faulty calculation of the column number. A patter search
approach might therefore be much more robust at column number calculations.
Index: compiler.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/compiler.vim,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** compiler.vim 20 Nov 2002 11:09:58 -0000 1.13
--- compiler.vim 21 Nov 2002 09:58:06 -0000 1.14
***************
*** 3,7 ****
" Author: Srinath Avadhanula
" Created: Tue Apr 23 05:00 PM 2002 PST
! " Last Change: Wed Nov 20 03:00 AM 2002 PST
"
" Description: functions for compiling/viewing/searching latex documents
--- 3,7 ----
" Author: Srinath Avadhanula
" Created: Tue Apr 23 05:00 PM 2002 PST
! " Last Change: Thu Nov 21 12:00 AM 2002 PST
"
" Description: functions for compiling/viewing/searching latex documents
***************
*** 121,125 ****
cwindow
" if we moved to a different window, then it means we had some errors.
! if winnum != winnr()
call UpdatePreviewWindow(mainfname)
exe 'nnoremap <buffer> <silent> j j:call UpdatePreviewWindow("'.mainfname.'")<CR>'
--- 121,125 ----
cwindow
" if we moved to a different window, then it means we had some errors.
! if winnum != winnr() && glob(mainfname.'.log') != ''
call UpdatePreviewWindow(mainfname)
exe 'nnoremap <buffer> <silent> j j:call UpdatePreviewWindow("'.mainfname.'")<CR>'
***************
*** 127,131 ****
exe 'nnoremap <buffer> <silent> <up> <up>:call UpdatePreviewWindow("'.mainfname.'")<CR>'
exe 'nnoremap <buffer> <silent> <down> <down>:call UpdatePreviewWindow("'.mainfname.'")<CR>'
! exe 'nnoremap <buffer> <silent> <enter> :call GotoErrorLocation("'.mainfname.'", '.winnum.')<CR>'
" resize the window to just fit in with the number of lines.
--- 127,131 ----
exe 'nnoremap <buffer> <silent> <up> <up>:call UpdatePreviewWindow("'.mainfname.'")<CR>'
exe 'nnoremap <buffer> <silent> <down> <down>:call UpdatePreviewWindow("'.mainfname.'")<CR>'
! exe 'nnoremap <buffer> <silent> <enter> <enter>:wincmd w<cr>:call GotoErrorLocation("'.mainfname.'", '.winnum.')<CR>'
" resize the window to just fit in with the number of lines.
***************
*** 238,241 ****
--- 238,242 ----
" Description:
function! PositionPreviewWindow(filename)
+
if getline('.') !~ '|\d\+ \(error\|warning\)|'
if !search('|\d\+ \(error\|warning\)|')
***************
*** 244,248 ****
--- 245,268 ----
endif
endif
+
+ let errpat = matchstr(getline('.'), '\zs|\d\+ \(error\|warning\)|\ze')
let linenum = matchstr(getline('.'), '|\zs\d\+\ze \(error\|warning\)|')
+
+ let errline = line('.')
+ 0
+ let numrep = 0
+ while 1
+ if getline('.') =~ errpat
+ let numrep = numrep + 1
+ normal! 0
+ call search('|\d\+ \(warning\|error\)|')
+ endif
+ if line('.') == errline
+ break
+ else
+ call search(errpat, 'W')
+ endif
+ endwhile
+
if getline('.') =~ '|\d\+ warning|'
let searchpat = escape(matchstr(getline('.'), '|\d\+ warning|\s*\zs.*'), '\ ')
***************
*** 250,253 ****
--- 270,274 ----
let searchpat = 'l.'.linenum
endif
+
exec 'bot pedit +/'.searchpat.'/ '.a:filename.'.log'
" TODO: This is not robust enough. Check that a wincmd j actually takes
***************
*** 255,258 ****
--- 276,287 ----
" first time around.
wincmd j
+ if searchpat =~ 'l.\d\+' && numrep > 1
+ while numrep > 1
+ call search(searchpat, 'W')
+ normal! z.
+ let numrep = numrep - 1
+ endwhile
+ endif
+
endfunction " }}}
" UpdatePreviewWindow: updates the view of the log file {{{
|