Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax for package "comment": \begin{env}[options] and \end{env} appear as not being commented #2626

Closed
kiryph opened this issue Feb 2, 2023 · 3 comments

Comments

@kiryph
Copy link
Contributor

kiryph commented Feb 2, 2023

Following LaTeX file

\documentclass{article}
\usepackage{comment} 

\begin{document}

\begin{comment}
  text text text text text text text text text text text text text 
  $a=b$
  text text text text text text text text text text text text text 
\end{comment}


\begin{comment}
  text text text text text text text text text text text text text 
  \begin{equation}
    a=b
  \end{equation}
  text text text text text text text text text text text text text 
  \begin{empheq}[box=\widefbox]{align*}
    c_1 &= a\\
    c_2 &= b\\
    c_3 &= c
  \end{empheq}
  text text text text text text text text text text text text text 
\end{comment}

\end{document}

appears in neovim 0.8.2 with vimtex installed as following
Screenshot 2023-02-02 at 08 05 11

Describe the solution you'd like
Lines 15, 17, 19, and 23 should also be greyed out.

@kiryph kiryph changed the title Syntax for package "comment": \begin{env} and \end{env} appears as not being commented Syntax for package "comment": \begin{env}[options] and \end{env} appear as not being commented Feb 2, 2023
@lervag
Copy link
Owner

lervag commented Feb 2, 2023

Thanks, I've fixed this now. It will still break on the following edge case, but I think that's ok:

\begin{comment}
  \begin{comment}
    text text text text text text text text text text text text text
  \end{comment}
  text text text text text text text text text text text text text
\end{comment}

It would probably not be impossible to fix that, but it would be much harder because I would have to find another technique entirely. And it seems very unlikely that anyone would actually do this in real life?

@lervag lervag closed this as completed Feb 2, 2023
@kiryph
Copy link
Contributor Author

kiryph commented Feb 2, 2023

And it seems very unlikely that anyone would actually do this in real life?

I would not do this. I could imagine that other people are doing it, but I am not one of them.
IMHO the edge case of nested comment environments is not important enough to find a completely new technique.

Thanks as always for the quick fix.

@lervag
Copy link
Owner

lervag commented Feb 2, 2023

Hmm.. I guess it is a good rule to never assume what other people will do or not do ;)

Anyway, I'm happy to get good issues that help me keep improving VimTeX. So thanks to you for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants