I believe I have run into a bug in the Tex_ViewLaTeX function under Mac
OS X. Each time Tex_ViewLaTeX() runs on a macunix system, it prepends an
additional '-a ' to the s:viewer variable. If Tex_ViewLaTeX is called
multiple times in a given session, (using '\lv', for example) it only
successfully runs the viewer every other time it is called.

This leads to Tex_PrintDebug() output along the lines of:

comp : Tex_ViewLaTeX: execString = open -a /Applications/Skim.app thesis.pdf
comp : Tex_ViewLaTeX: execString = open -a -a /Applications/Skim.app thesis.pdf
comp : Tex_ViewLaTeX: execString = open -a -a -a /Applications/Skim.app 
thesis.pdf

Attached is a patch I created as a workaround to this problem. The patch
inserts a '-a ' in execString if s:viewer is nonempty, rather than
modifying s:viewer each time Tex_ViewLaTeX() is called. This ensures
that there is only ever a single '-a' in execString, if a viewer program
is specified.

I had this problem with latexSuite20060325, but it looks like it may
still exist in the subversion trunk.

-- 
......................................................................
William (B.J.) Snow Orvis     PGP Fingerprint:
aetherkni...@gmail.com        E6DC E687 EBB7 E99C 1BCE
http://ouroboros.homedns.org  D04F 057B 0CD0 8A49 3E98

Random link:
Electronic Frontier Foundation: http://www.eff.org
diff --git a/.vim/ftplugin/latex-suite/compiler.vim 
b/.vim/ftplugin/latex-suite/compiler.vim
--- a/.vim/ftplugin/latex-suite/compiler.vim
+++ b/.vim/ftplugin/latex-suite/compiler.vim
@@ -247,9 +247,11 @@ function! Tex_ViewLaTeX()
 
        elseif has('macunix')
                if strlen(s:viewer)
-                       let s:viewer = '-a '.s:viewer
+                       let appOpt = '-a '
+               else
+                       let appOpt = ''
                endif
-               let execString = 'open '.s:viewer.' $*.'.s:target
+               let execString = 'open '.appOpt.s:viewer.' $*.'.s:target
 
        else
                " taken from Dimitri Antoniou's tip on vim.sf.net (tip #225).

Attachment: pgpFMF3MfcPTo.pgp
Description: PGP signature

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Vim-latex-devel mailing list
Vim-latex-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vim-latex-devel

Reply via email to