Re: [Vim-latex-devel] bug in \cite-completion of 1.5
Brought to you by:
srinathava,
tmaas
From: Srinath A. <sr...@fa...> - 2003-12-17 01:05:11
|
Hi Lasse, On Wed, 17 Dec 2003, Lasse Kliemann wrote: > > I could reproduce the problem too. I made a different patch to solve > > this problem. Its now in CVS. I made a release with this patch. Please > > try out the latest developement version. (Don't worry, its as stable > > as 1.5). > > The first problem is corrected by your changes, but the insertion of the > completed word still did not work for me. I could fix it by a similar > measure as before, patch is attached. It must be something with that > regexp, and since I am no expert on these, I can only offer a likely > temporary fix. Could you please describe your problem a bit more? For example, what was expected to happen and what really happened. It will help if you tell us the line containing the \ref command and also the line containing the \bibitem command so I can reproduce it here... As it stands, I am not really sure what the patch is supposed to accomplish. According to me, the following patch is somewhat more safe. Could you try it out and let me know. Actually, I have _no_ idea why Mikolaj used a comma "," in that last regexp there. Mikolaj? I would have preferred just '{\zs.*\ze' as Lasse has suggested, but maybe the comma is necessary in some cases? Srinath Index: texviewer.vim =================================================================== RCS file: /cvsroot/vim-latex/vimfiles/ftplugin/tex/texviewer.vim,v retrieving revision 1.36 diff -c -r1.36 texviewer.vim *** texviewer.vim 16 Dec 2003 23:41:10 -0000 1.36 --- texviewer.vim 17 Dec 2003 01:02:12 -0000 *************** *** 332,338 **** if getline('.') =~ '\\bibitem{' let bibkey = matchstr(getline('.'), '\\bibitem{\zs.\{-}\ze}') else ! let bibkey = matchstr(getline('.'), '{\zs.\{-}\ze,') endif let completeword = strpart(bibkey, strlen(s:prefix)) --- 332,338 ---- if getline('.') =~ '\\bibitem{' let bibkey = matchstr(getline('.'), '\\bibitem{\zs.\{-}\ze}') else ! let bibkey = matchstr(getline('.'), '{\zs.\{-}\ze\(,\|$\)') endif let completeword = strpart(bibkey, strlen(s:prefix)) |