[Vim-latex-devel] Labels with spaces fools <F9>
Brought to you by:
srinathava,
tmaas
From: <pat...@fr...> - 2010-10-27 17:21:54
|
Dear vim-latex-devel, As reported in http://permalink.gmane.org/gmane.comp.editors.vim.latex.devel/88 if your LaTeX file contains something like \label{section:Important stuff} (note the space between Important and stuff) then \ref{<F9>} will bring a correct outline buffer but when you press Enter on the line section:Important stuff you will get in your original file: \ref{section:Important} instead of the expected \ref{section:Important stuff} I wouldn't have expected LaTeX to like labels containing spaces until one of my collaborators used some and LaTeX liked them! The problem in vim-latex is in file $VIM/addons/ftplugin/latex-suite which contains the function Tex_FinishOutlineCompletion. The faulty regex is in the line let ref_complete = matchstr(getline('.'), '^>\s\+\zs\S\+\ze') I've replaced it with let ref_complete = matchstr(getline('.'), '^>\s\+\zs[^<\t]\+\ze') which works for me but I don't say this is a well thought out solution. Best, Patrick Massot |