[Vim-latex-cvs] vimfiles/ftplugin/latex-suite packages.vim,1.20,1.21
Brought to you by:
srinathava,
tmaas
|
From: <mi...@us...> - 2003-01-14 13:40:43
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv19148
Modified Files:
packages.vim
Log Message:
- Added to Tex_pack_all() scanning for \newenvironment and \newcommand
lines and adds new names to g:Tex_Prompted variables.
- Updating is based on g:Tex_...Default, whole scanning is done from
nil, thus it should work for removing \new..., but it doesn't work :(
It looks like SetUp...Prompt uses some cached values.
Index: packages.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/packages.vim,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** packages.vim 12 Jan 2003 22:02:40 -0000 1.20
--- packages.vim 14 Jan 2003 13:40:39 -0000 1.21
***************
*** 124,127 ****
--- 124,130 ----
" and if supported, loads the options and commands found in the
" corresponding package file.
+ " Now scans also for \newenvironment and \newcommand lines and adds names to
+ " g:Tex_Prompted variables, they can be easy available through <F5> and <F7>
+ " shortcuts
function! Tex_pack_all()
***************
*** 143,146 ****
--- 146,150 ----
0
let beginline = search('\\begin{document}', 'W')
+ let endline = search('\\end{document}', 'W')
0
***************
*** 189,192 ****
--- 193,230 ----
endwhile
+
+ " Scans whole file (up to \end{document}) for \newcommand and adds this
+ " commands to g:Tex_PromptedCommands variable, it is easily available
+ " through <F7>
+ 0
+ let s:Tex_LookForCommand = g:Tex_PromptedCommandsDefault
+ while search('^\s*\\newcommand\*\?{.\{-}}', 'W')
+
+ if line('.') > endline
+ break
+ endif
+
+ let newcommand = matchstr(getline('.'), '\\newcommand\*\?{\\\zs.\{-}\ze}')
+ let s:Tex_LookForCommand = s:Tex_LookForCommand . ',' . newcommand
+
+ endwhile
+ let g:Tex_PromptedCommands = s:Tex_LookForCommand
+
+ " Scans whole file (up to \end{document}) for \newenvironment and adds this
+ " environments to g:Tex_PromptedEnvironments variable, it is easily available
+ " through <F5>
+ 0
+ let s:Tex_LookForEnvironment = g:Tex_PromptedEnvironmentsDefault
+ while search('^\s*\\newenvironment\*\?{.\{-}}', 'W')
+
+ if line('.') > endline
+ break
+ endif
+
+ let newenvironment = matchstr(getline('.'), '\\newenvironment\*\?{\zs.\{-}\ze}')
+ let s:Tex_LookForEnvironment = s:Tex_LookForEnvironment . ',' . newenvironment
+
+ endwhile
+ let g:Tex_PromptedEnvironments = s:Tex_LookForEnvironment
if toquit
|