Skip to content

Commit 85cb04f

Browse files
committed
feat(syntax): allow comments in pgfcoordinates
refer: #3159
1 parent 4fbf861 commit 85cb04f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

autoload/vimtex/syntax/p/pgfplots.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ function! vimtex#syntax#p#pgfplots#load(cfg) abort " {{{1
4141

4242

4343
syntax match texPgfType "coordinates" contained nextgroup=texPgfCoordinates skipwhite skipnl
44-
call vimtex#syntax#core#new_arg('texPgfCoordinates', {'contains': ''})
44+
call vimtex#syntax#core#new_arg('texPgfCoordinates', {
45+
\ 'contains': 'texComment'
46+
\})
4547

4648

4749
syntax match texPgfNode "node" contained nextgroup=texTikzNodeOpt skipwhite skipnl

test/test-syntax/test-tikz.tex

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,15 @@
9494
\label{fig:instspill-t}
9595
\end{figure}
9696

97+
\begin{tikzpicture}
98+
% a comment with correct highlighting
99+
\begin{axis}
100+
\addplot coordinates {
101+
% a comment with incorrect highlighting
102+
(0,0)
103+
(1,1)
104+
};
105+
\end{axis}
106+
\end{tikzpicture}
107+
97108
\end{document}

0 commit comments

Comments
 (0)