[Vim-latex-cvs] vimfiles/ftplugin/latex-suite envmacros.vim,1.47,1.48
Brought to you by:
srinathava,
tmaas
From: <sri...@us...> - 2004-05-25 18:51:31
|
Update of /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31535 Modified Files: envmacros.vim Log Message: Bug: <F7> for inserting commands doesn't work in Insert mode and works buggily in Normal mode. Why: Used <cword> to extract the word under the cursor which doesn't work if the cursor is just past the end of a word. This is a common occurence when <F7> is pressed just after typing a word. Also in normal mode, just used the part of the word which is before the cursor. Fix: Use matchstr(getline('.'), '\w\+$') to extract the word before the cursor. This works even after the end of a word in insert mode. Index: envmacros.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/latex-suite/envmacros.vim,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** envmacros.vim 15 Mar 2004 19:40:48 -0000 1.47 --- envmacros.vim 25 May 2004 18:51:10 -0000 1.48 *************** *** 995,999 **** endif else ! let lastword = expand('<cword>') if lastword != '' return substitute(lastword, '.', "\<bs>", 'g').Tex_PutCommand(lastword) --- 995,1000 ---- endif else ! let lastword = matchstr(getline('.'), '\w\+$') ! call Tex_Debug("Tex_DoCommand: getting lastword = ".lastword, "env") if lastword != '' return substitute(lastword, '.', "\<bs>", 'g').Tex_PutCommand(lastword) *************** *** 1042,1046 **** inoremap <silent> <Plug>Tex_FastCommandInsert <C-r>=Tex_FastCommandInsert('no')<cr> ! nnoremap <silent> <Plug>Tex_FastCommandInsert i<C-r>=Tex_FastCommandInsert('no')<cr> inoremap <silent> <Plug>Tex_FastCommandChange <C-O>:call Tex_ChangeCommand('no')<CR> nnoremap <silent> <Plug>Tex_FastCommandChange :call Tex_ChangeCommand('no')<CR> --- 1043,1047 ---- inoremap <silent> <Plug>Tex_FastCommandInsert <C-r>=Tex_FastCommandInsert('no')<cr> ! nnoremap <silent> <Plug>Tex_FastCommandInsert ea<C-r>=Tex_FastCommandInsert('no')<cr> inoremap <silent> <Plug>Tex_FastCommandChange <C-O>:call Tex_ChangeCommand('no')<CR> nnoremap <silent> <Plug>Tex_FastCommandChange :call Tex_ChangeCommand('no')<CR> |