Re: [Vim-latex-devel] opening .aux file
Brought to you by:
srinathava,
tmaas
From: Christoffer D. <cd...@cs...> - 2012-08-09 18:03:51
|
Hi Ted, Thanks for your fast response! On Thu, Aug 9, 2012 at 1:52 PM, Ted Pavlic <te...@te...> wrote: > Christoffer -- > > Please review (including the "UPDATES" at the top): > > http://phaseportrait.blogspot.com/2008/03/fixing-vim-latex-compiler-error.html > > and see if you can gain some traction. The problem you're encountering > is more a fundamental problem with how vim processes error messages. The > kinds of error messages that LaTeX provides have scopes that span over > several lines, and it is a little hard for vim to track sometimes. > Consequently, sometimes it picks the wrong file. > I tried this, but unfortunately for some errors, the file is still the .aux file, for example when defining multiple labels with the same name. I added a horrible hack to the vim-latex code though, which some might benefit from, but there are surely much better ways to do it: diff --git a/ftplugin/latex-suite/compiler.vim b/ftplugin/latex-suite/compiler.vim index 28213fa..d4552c2 100644 --- a/ftplugin/latex-suite/compiler.vim +++ b/ftplugin/latex-suite/compiler.vim @@ -784,6 +784,15 @@ endfunction " }}} " " The position is both the correct line number and the column number. function! Tex_GotoErrorLocation(filename) + " HACK ALERT: Avoid opening the .aux file and piss off the author + let mainFileName_root = Tex_GetMainFileName(':p:t:r') + let auxFileName = escape(mainFileName_root.'.aux', '.') + let potAuxLine = getline('.') + " let pattern = auxFileName.'||.*' + if match(potAuxLine, auxFileName.'||.*') != -1 + cclose + return + endif " first use vim's functionality to take us to the location of the error " accurate to the line (not column). This lets us go to the correct file -- 1.7.10 Best, Christoffer |