Skip to content

Commit

Permalink
fix(syntax): comment environment should be texComment all the way
Browse files Browse the repository at this point in the history
refer: #2626
  • Loading branch information
lervag committed Feb 2, 2023
1 parent b860708 commit 8ef5b0d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
9 changes: 8 additions & 1 deletion autoload/vimtex/syntax/p/comment.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
"

function! vimtex#syntax#p#comment#load(cfg) abort " {{{1
call vimtex#syntax#core#new_region_env('texComment', 'comment')
syntax region texComment
\ start="\\begin{comment}"
\ end="\\end{comment}"
\ contains=texCommentEnv
\ keepend
syntax match texCommentEnv "\\\%(begin\|end\){comment}"
\ contained
\ contains=texCmdEnv
endfunction

" }}}1
14 changes: 14 additions & 0 deletions test/test-syntax/test-comment.tex
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,18 @@
Line with $inline math$ here.\footnote{here {asd} with \cmd also}.
\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}

0 comments on commit 8ef5b0d

Please sign in to comment.