Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite
In directory sc8-pr-cvs1:/tmp/cvs-serv7963
Modified Files:
envmacros.vim
Log Message:
Bug: <F5> does not work if we type in the name of a package latex-suite
doesn't recognize. a 0 is inserted.
Cause: In the recent feature where Tex_PutEnvironment also tried to scan
environments added by packages, there is no fail-safe at the end of
all the if statements.
Solution: if all else fails remember to at least insert a bare-bones
environment.
Index: envmacros.vim
===================================================================
RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** envmacros.vim 8 Jun 2003 20:25:50 -0000 1.32
--- envmacros.vim 17 Jun 2003 02:00:13 -0000 1.33
***************
*** 3,7 ****
" Author: Mikolaj Machowski
" Created: Tue Apr 23 08:00 PM 2002 PST
! " CVS Header:
" Description: mappings/menus for environments.
"=============================================================================
--- 3,7 ----
" Author: Mikolaj Machowski
" Created: Tue Apr 23 08:00 PM 2002 PST
! " CVS Header: $Id$
" Description: mappings/menus for environments.
"=============================================================================
***************
*** 508,527 ****
" Description:
function! PromptForEnvironment(ask)
!
! if !exists('s:common_env_prompt')
! let s:common_env_prompt =
! \ "\n" .
! \ Tex_CreatePrompt(g:Tex_PromptedEnvironments, 2, ',') .
! \ "Enter number or name of environment: "
! endif
!
! let inp = input(a:ask.s:common_env_prompt)
! if inp =~ '^[0-9]\+$'
! let env = Tex_Strntok(g:Tex_PromptedEnvironments, ',', inp)
! else
! let env = inp
! endif
!
! return env
endfunction " }}}
" Tex_DoEnvironment: fast insertion of environments {{{
--- 508,516 ----
" Description:
function! PromptForEnvironment(ask)
! return Tex_ChooseFromPrompt(
! \ a:ask."\n" .
! \ Tex_CreatePrompt(g:Tex_PromptedEnvironments, 2, ",") .
! \ "\nEnter nae or number of environment :",
! \ g:Tex_PromptedEnvironments, ",")
endfunction " }}}
" Tex_DoEnvironment: fast insertion of environments {{{
***************
*** 598,605 ****
let i = i + 1
endwhile
- else
- return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>\\end{".a:env."}<++>")
- endif
endif
endif
endfunction " }}}
--- 587,594 ----
let i = i + 1
endwhile
endif
+ " If nothing before us managed to create an environment, then just
+ " create a bare-bones environment from the name.
+ return IMAP_PutTextWithMovement('\begin{'.a:env."}\<cr><++>\<cr>\\end{".a:env."}<++>")
endif
endfunction " }}}
|