Skip to content

Commit

Permalink
fix: minor error in chemformula syntax support
Browse files Browse the repository at this point in the history
refer: #2235
  • Loading branch information
lervag committed Dec 19, 2021
1 parent cf93b41 commit 3cd3794
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions autoload/vimtex/syntax/p/chemformula.vim
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ function! vimtex#syntax#p#chemformula#load(cfg) abort " {{{1
syntax match texCHSymb contained "->\|+\|-"

syntax region texCHText matchgroup=texDelim keepend start=/"/ end=/"/
\ contains=TOP,@NoSpell
\ contains=TOP,@NoSpell contained
syntax region texCHText matchgroup=texDelim keepend start=/'/ end=/'/
\ contains=TOP,@NoSpell
\ contains=TOP,@NoSpell contained

syntax match texCmdCH "\\ch\>"
\ nextgroup=texCHOpt,texCHArg skipwhite skipnl
Expand Down
2 changes: 2 additions & 0 deletions test/test-syntax/test-chemformula.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@
\ch{M -> M^{n+} + ne^{-}}
\end{equation}

\footnote{For these citations, see Stephen's quotation.}

\end{document}
5 changes: 4 additions & 1 deletion test/test-syntax/test-chemformula.vim
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ silent edit test-chemformula.tex

if empty($INMAKE) | finish | endif

quit!
call assert_true(vimtex#syntax#in('texFootnoteArg', 25, 48))
call assert_true(!vimtex#syntax#in('texCHText', 25, 48))

call vimtex#test#finished()

0 comments on commit 3cd3794

Please sign in to comment.