Skip to content

let texMathZones ignore the zone before \begin{document} #2052

@Edenharder

Description

@Edenharder

Describe the bug
It seems that some function like texMathZones in vimtex takes the zone before \begin{document} also into consideration. This is unnecessary and causes problem sometimes.
To Reproduce
For example,

\documentclass{article}
\usepackage{array}
\newcolumntype{C}{>{$}c<{$}} %1
\begin{document}
$This part is detected as not texMathZones$ %2
This part is detected as texMathZones %3
\end{document}

With vimtex on, the line %1 contains $, and it is before the beginning of the document. Then the part between the two $ in place %2has not been detected as texMathZones. Instead, the part in place %3, which should not be a texMathZones, is detected as texMathZones.

With vimtex off, everything is correct.

Expected behavior
The function like texMathZones in vimtex should ignore the zone before the beginning of the document.

Environment (please complete the following information):

  • Vim version 8.2

Related issue: let texMathZones ignore the zone before \begin{document}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions