Skip to content

Commit e42225e

Browse files
committed
wip: use texMathCmdStyle for math style commands
1 parent f7b80ff commit e42225e

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Diff for: autoload/vimtex/syntax/core.vim

+12-10
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,6 @@ function! vimtex#syntax#core#init() abort " {{{1
190190
syntax match texCmdStyle "\\textup\>"
191191
syntax match texCmdStyle "\\emph\>"
192192

193-
syntax match texCmdStyle "\\mathbb\>"
194-
syntax match texCmdStyle "\\mathbf\>"
195-
syntax match texCmdStyle "\\mathcal\>"
196-
syntax match texCmdStyle "\\mathfrak\>"
197-
syntax match texCmdStyle "\\mathit\>"
198-
syntax match texCmdStyle "\\mathnormal\>"
199-
syntax match texCmdStyle "\\mathrm\>"
200-
syntax match texCmdStyle "\\mathsf\>"
201-
syntax match texCmdStyle "\\mathtt\>"
202-
203193
syntax match texCmdStyle "\\rmfamily\>"
204194
syntax match texCmdStyle "\\sffamily\>"
205195
syntax match texCmdStyle "\\ttfamily\>"
@@ -378,6 +368,17 @@ function! vimtex#syntax#core#init() abort " {{{1
378368
syntax match texCmdMathText "\\\(\(inter\)\?text\|mbox\)\>" nextgroup=texMathTextArg
379369
call vimtex#syntax#core#new_arg('texMathTextArg')
380370

371+
" Math style commands
372+
syntax match texMathCmdStyle "\\mathbb\>"
373+
syntax match texMathCmdStyle "\\mathbf\>"
374+
syntax match texMathCmdStyle "\\mathcal\>"
375+
syntax match texMathCmdStyle "\\mathfrak\>"
376+
syntax match texMathCmdStyle "\\mathit\>"
377+
syntax match texMathCmdStyle "\\mathnormal\>"
378+
syntax match texMathCmdStyle "\\mathrm\>"
379+
syntax match texMathCmdStyle "\\mathsf\>"
380+
syntax match texMathCmdStyle "\\mathtt\>"
381+
381382
" Support for array environment
382383
syntax match texMathCmdEnv contained contains=texCmdMathEnv "\\begin{array}" nextgroup=texMathArrayArg skipwhite skipnl
383384
syntax match texMathCmdEnv contained contains=texCmdMathEnv "\\end{array}"
@@ -581,6 +582,7 @@ function! s:init_highlights() abort " {{{1
581582
highlight def link texMathArg texMathRegion
582583
highlight def link texMathArrayArg texOpt
583584
highlight def link texMathCmd texCmd
585+
highlight def link texMathCmdStyle texMathCmd
584586
highlight def link texMathDelimMod texMathDelim
585587
highlight def link texMathDelimRegion texDelim
586588
highlight def link texMathError texError

0 commit comments

Comments
 (0)