Hi Ted,

Thanks for your fast response!

On Thu, Aug 9, 2012 at 1:52 PM, Ted Pavlic <t...@tedpavlic.com> 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

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to