[Vim-latex-cvs] SF.net SVN: vim-latex: [1008] trunk/vimfiles/ftplugin/latex-suite
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2006-03-29 06:15:12
|
Revision: 1008 Author: srinathava Date: 2006-03-28 22:15:08 -0800 (Tue, 28 Mar 2006) ViewCVS: http://svn.sourceforge.net/vim-latex/?rev=1008&view=rev Log Message: ----------- New: Support the Tex_ImageDir setting more fully. Now when Tex_ImageDir is found, then pressing <F9> to complete \includegraphics will open up the file-browser on the directory pointed to by Tex_ImageDir. When a file is chosen, the filename is completed relative to Tex_ImageDir. Modified Paths: -------------- trunk/vimfiles/ftplugin/latex-suite/texviewer.vim trunk/vimfiles/ftplugin/latex-suite/version.vim Modified: trunk/vimfiles/ftplugin/latex-suite/texviewer.vim =================================================================== --- trunk/vimfiles/ftplugin/latex-suite/texviewer.vim 2006-03-29 06:11:01 UTC (rev 1007) +++ trunk/vimfiles/ftplugin/latex-suite/texviewer.vim 2006-03-29 06:15:08 UTC (rev 1008) @@ -147,25 +147,33 @@ call Tex_SetupFileCompletion( \ '', \ '^\.\\|\.tex$\\|\.bib$\\|\.bbl$\\|\.zip$\\|\.gz$', - \ 'noext') + \ 'noext', + \ Tex_GetVarValue('Tex_ImageDir', '.'), + \ Tex_GetVarValue('Tex_ImageDir', '')) elseif exists("s:type") && s:type == 'bibliography' call Tex_SetupFileCompletion( \ '\.b..$', \ '', - \ 'noext') + \ 'noext', + \ '.', + \ '') elseif exists("s:type") && s:type =~ 'include\(only\)\=' call Tex_SetupFileCompletion( \ '\.t..$', \ '', - \ 'noext') + \ 'noext', + \ '.', + \ '') elseif exists("s:type") && s:type == 'input' call Tex_SetupFileCompletion( \ '', \ '', - \ 'ext') + \ 'ext', + \ '.', + \ '') elseif exists('s:type') && exists("g:Tex_completion_".s:type) call <SID>Tex_CompleteRefCiteCustom('plugin_'.s:type) @@ -235,23 +243,25 @@ " ============================================================================== " Tex_SetupFileCompletion: {{{ " Description: -function! Tex_SetupFileCompletion(accept, reject, ext) +function! Tex_SetupFileCompletion(accept, reject, ext, dir, root) call FB_SetVar('FB_AllowRegexp', a:accept) call FB_SetVar('FB_RejectRegexp', a:reject) call FB_SetVar('FB_CallBackFunction', 'Tex_CompleteFileName') - call FB_SetVar('FB_CallBackFunctionArgs', '"'.a:ext.'"') + call FB_SetVar('FB_CallBackFunctionArgs', '"'.a:ext.'", "'.a:root.'"') - call FB_OpenFileBrowser(Tex_GetVarValue('Tex_ImageDir', '.')) + call FB_OpenFileBrowser(a:dir) endfunction " }}} " Tex_CompleteFileName: {{{ " Description: -function! Tex_CompleteFileName(filename, ext) +function! Tex_CompleteFileName(filename, ext, root) + let root = (a:root == '' ? Tex_GetMainFileName(':p:h') : a:root) + call Tex_Debug('+Tex_CompleteFileName: getting filename '.a:filename, 'view') if a:ext == 'noext' let completeword = fnamemodify(a:filename, ':r') endif - let completeword = Tex_RelPath(completeword, Tex_GetMainFileName(':p:h')) + let completeword = Tex_RelPath(completeword, root) call Tex_Debug(":Tex_CompleteFileName: completing with ".completeword, "view") call Tex_CompleteWord(completeword) Modified: trunk/vimfiles/ftplugin/latex-suite/version.vim =================================================================== --- trunk/vimfiles/ftplugin/latex-suite/version.vim 2006-03-29 06:11:01 UTC (rev 1007) +++ trunk/vimfiles/ftplugin/latex-suite/version.vim 2006-03-29 06:15:08 UTC (rev 1008) @@ -24,7 +24,7 @@ " "stabilize" that version by releasing a few pre-releases and then " keep that as a stable point. function! Tex_Version() - return "Latex-Suite: version 1.8.16" + return "Latex-Suite: version 1.8.17" endfunction com! -nargs=0 TVersion echo Tex_Version() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |