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

Allow optional group and more than one mandatory argument in nospell commands #2118

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions autoload/vimtex/syntax/core.vim
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,10 @@ function! vimtex#syntax#core#init() abort " {{{1

" Add @NoSpell for commands per configuration (TOP,@Spell implies NoSpell!)
for l:macro in g:vimtex_syntax_nospell_commands
execute 'syntax match texCmdNoSpell nextgroup=texNoSpellArg skipwhite skipnl "\\' . l:macro . '"'
execute 'syntax match texCmdNoSpell nextgroup=texNoSpellOpt,texNoSpellArg skipwhite skipnl "\\' . l:macro . '"'
endfor
call vimtex#syntax#core#new_arg('texNoSpellArg', {'contains': 'TOP,@Spell'})
call vimtex#syntax#core#new_opt('texNoSpellOpt', {'next': 'texNoSpellArg'})
call vimtex#syntax#core#new_arg('texNoSpellArg', {'next': 'texNoSpellArg', 'contains': 'TOP,@Spell'})

" \begin \end environments
syntax match texCmdEnv "\v\\%(begin|end)>" nextgroup=texEnvArgName
Expand Down Expand Up @@ -758,6 +759,7 @@ function! vimtex#syntax#core#init_highlights() abort " {{{1
highlight def link texNewthmArgName texArg
highlight def link texNewthmOptCounter texOpt
highlight def link texNewthmOptNumberby texOpt
highlight def link texNoSpellOpt texOpt
highlight def link texOptEqual texSymbol
highlight def link texParboxOptHeight texError
highlight def link texParboxOptIPos texError
Expand Down