gerw / vim-latex-suite

71 stars 16 forks source link

Multiple \begin{document} messes with <F5> completion #21

Closed kstensbo closed 8 years ago

kstensbo commented 9 years ago

Look at the following minimal example:

\documentclass{article}
\begin{document}

The \verb!document! environment starts with \verb!\begin{document}!.

\end{document}

Using <F5> to expand an environment between \begin{document} and \verb!\begin{document}! will insert a \usepackage{}, while below \verb!\begin{document}! it will (correctly) insert an environment.

Is it possible to make vim-latex-suite use the first occurrence of \begin{document} to indicate the beginning of the document?

gerw commented 8 years ago

This was quite a silly issue with the search flags in the ´Tex_FastEnvironmentInsert´-function. This function also failed if the ´wrapscan´ option was not set.