[Vim-latex-cvs] vimfiles/ftplugin/latex-suite texproject.vim,1.5,1.6
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2004-05-22 01:21:29
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1953 Modified Files: texproject.vim Log Message: Bug: The .latexmain file is only sourced on the first file which is opened. Why: We did not catch the LatexSuiteFileType event Fix: Catch the LatexSuiteFileType event and source the master file for every file opened. Basically, the .latexmain file acts like a project specific ftplugin file. New: Removed a lot of code from old which seems to be no longer used. Unless we actually change things around to once again use g:projFiles etc, it looks like this is just not doing anything. Index: texproject.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/texproject.vim,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** texproject.vim 15 Dec 2003 03:33:52 -0000 1.5 --- texproject.vim 22 May 2004 01:21:19 -0000 1.6 *************** *** 6,10 **** " " Description: Handling tex projects. - " "============================================================================= --- 6,9 ---- *************** *** 12,17 **** command! -nargs=0 TProjectEdit :call <SID>Tex_ProjectEdit() - command! -nargs=0 TProjectWrite :call <SID>Tex_ProjectWrite() - command! -nargs=0 TProject :call <SID>Tex_Project() " Tex_ProjectEdit: Edit project file " {{{ --- 11,14 ---- *************** *** 27,74 **** exec 'split '.Tex_EscapeSpaces(mainfname.'.latexmain') else ! exec 'split '.Tex_EscapeSpaces(s:path.'/projecttemplate.vim') ! exec 'saveas '.Tex_EscapeSpaces(file.'.latexmain') ! let g:Tex_ProjectExists = 1 ! endif ! ! endfunction " }}} ! " Tex_ProjectWrite: write project and source it to refresh changed vars {{{ ! " Description: ! " ! function! s:Tex_ProjectWrite() ! ! if expand("%:e") =~ 'latexmain$' ! write! ! source % ! q ! else ! echoerr "Sorry, this is not project file" ! return endif endfunction " }}} ! " Tex_Project: open project view in explorer {{{ ! " Description: ! " ! function! s:Tex_Project() ! if g:Tex_ProjectExists == 1 ! new ! let w:projView = 1 ! :Explore ! else ! echoerr "Sorry, no project file exists" ! finish endif ! endfunction " }}} ! " Load project file if exists ! if glob(Tex_GetMainFileName().'.latexmain') != '' ! exe 'source '.Tex_GetMainFileName().'.latexmain' ! let g:Tex_ProjectExists = 1 ! else ! let g:Tex_ProjectExists = 0 ! endif " vim:fdm=marker:ff=unix:noet:ts=4:sw=4 --- 24,54 ---- exec 'split '.Tex_EscapeSpaces(mainfname.'.latexmain') else ! echohl WarningMsg ! echomsg "Master file not found." ! echomsg " :help latex-master-file" ! echomsg "for more information" ! echohl None endif endfunction " }}} ! " Tex_ProjectLoad: loads the .latexmain file {{{ ! " Description: If a *.latexmain file exists, then sources it ! function! Tex_ProjectLoad() ! let curd = getcwd() ! call Tex_CD(expand('%:p:h')) ! if glob(Tex_GetMainFileName(':p').'.latexmain') != '' ! call Tex_Debug("Tex_ProjectLoad: sourcing [".Tex_GetMainFileName().".latexmain]", "proj") ! exec 'source '.Tex_GetMainFileName().'.latexmain' endif ! ! call Tex_CD(curd) endfunction " }}} ! augroup LatexSuite ! au LatexSuite User LatexSuiteFileType ! \ call Tex_Debug("texproject.vim: catching LatexSuiteFileType event", "proj") | ! \ call Tex_ProjectLoad() ! augroup END " vim:fdm=marker:ff=unix:noet:ts=4:sw=4 |