Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv14480
Modified Files:
main.vim
Log Message:
Change: new function Tex_GetVarValue().
Change: support g:Tex_MainFileExpression. (Luc Hermitte)
Index: main.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/main.vim,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** main.vim 16 Jul 2003 16:44:41 -0000 1.42
--- main.vim 17 Jul 2003 07:30:43 -0000 1.43
***************
*** 391,398 ****
--- 391,416 ----
" }}}
+ " Tex_GetVarValue: gets the value of the variable {{{
+ " Description:
+ " See if a window-local, buffer-local or global variable with the given name
+ " exists and if so, returns the corresponding value. Otherwise return the
+ " provided default value.
+ function! Tex_GetVarValue(varname, default)
+ if exists('w:'.a:varname)
+ return w:{a:varname}
+ elseif exists('b:'.a:varname)
+ return b:{a:varname}
+ elseif exists('g:'.a:varname)
+ return g:{a:varname}
+ else
+ return a:default
+ endif
+ endfunction " }}}
" Tex_GetMainFileName: gets the name (without extension) of the main file being compiled. {{{
" Description: returns '' if .latexmain doesnt exist.
" i.e if main.tex.latexmain exists, then returns:
" d:/path/to/main
+ " if a:1 is supplied, then it is used to modify the *.latexmain
+ " file instead of using ':p:r:r'.
function! Tex_GetMainFileName(...)
if a:0 > 0
***************
*** 400,403 ****
--- 418,428 ----
else
let modifier = ':p:r:r'
+ endif
+
+ " If the user wants to use his own way to specify the main file name, then
+ " use it straight away.
+ if Tex_GetVarValue('Tex_MainFileExpression', '') != ''
+ exec 'let retval = '.Tex_GetVarValue('Tex_MainFileExpression', '')
+ return retval
endif
|