F9 \ref completion fails when a \label is inside a figure environment (fixed in 1.10.0)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vim-latexsuite (Ubuntu) |
In Progress
|
Undecided
|
Unassigned |
Bug Description
Release
=======
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Package version
===============
vim-latexsuite:
Installed: 1:1.9.0-1
Bug description
===============
When using (G)Vim 8.0 with latex-suite 1.9.0 on Ubuntu 18.04 LTS, with latex-suite installed from Ubuntu's package repositories, using the F9 key for \ref completion no longer works correctly in some circumstances.
This occurs when I have a \label within a figure environment, in which case a Python error message briefly appears, then vanishes leaving an empty __OUTLINE__ window. Removing the \label from the figure environment restores the usual behaviour (showing labels to select for insertion).
MWE:
\documentclass{
\begin{document}
\section{First}
\label{sec:first}
\subsection{Second}
\label{
\ref{sec:first}
\ref{}
\begin{figure}
\label{
\end{figure}
\end{document}
If I switch to insert mode and press F9 within the curly brackets for the \ref command in the above example, then the error below occurs and an empty __OUTLINE__ window is shown.
"__OUTLINE__" [New File]
line 23:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/
return getSectionLabel
File "/home/
sections[0], sectypes[1:], section_prefix, label_prefix)
File "/home/
section_prefix + ('%d.' % sec_num), label_prefix)
File "/home/
section_prefix + ('%d.' % sec_num), label_prefix)
File "/home/
sections[0], sectypes[1:], section_prefix, label_prefix)
File "/home/
return getSectionLabel
File "/home/
cm = re.search(
File "/usr/lib/
return _compile(pattern, flags).
File "/usr/lib/
p = sre_compile.
File "/usr/lib/
p = sre_parse.parse(p, flags)
File "/usr/lib/
p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
File "/usr/lib/
not nested and not items))
File "/usr/lib/
code = _escape(source, this, state)
File "/usr/lib/
raise source.error("bad escape %s" % escape, len(escape))
sre_constants.
line 24:
Traceback (most recent call last):
File "<string>", line 1, in <module>
This is missing the last line of the message, since I needed to capture it by resizing the window to make the error message paged.
If I comment out the \label in the figure environment, then press F9 in the same place, then the error does not occur and the __OUTLINE__ window contains the expected entries for the labelled sections.
According to discussion on the vim-latex github, this issue was fixed 2 years ago in commit 7d60db0 (https:/
See https:/
The fix should be included in the latest release of Vim LaTeX-suite on github (1.10.0). Can this package be upgraded to the latest release?
Status changed to 'Confirmed' because the bug affects multiple users.