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 braces in column specification for array env #2122

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion autoload/vimtex/syntax/core.vim
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,9 @@ function! vimtex#syntax#core#init() abort " {{{1
" Support for array environment
syntax match texMathCmdEnv contained contains=texCmdMathEnv "\\begin{array}" nextgroup=texMathArrayArg skipwhite skipnl
syntax match texMathCmdEnv contained contains=texCmdMathEnv "\\end{array}"
call vimtex#syntax#core#new_arg('texMathArrayArg', {'contains': ''})
call vimtex#syntax#core#new_arg('texMathArrayArg', {
\ 'contains': '@texClusterTabular'
\})

call s:match_math_sub_super()
call s:match_math_delims()
Expand Down
8 changes: 8 additions & 0 deletions test/test-syntax/test-array.tex
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@
\hline
\end{tabular}

\[
\begin{array}{l*{4}{m{1cm}}}
\hline
\text{Hello world !}\tabularnewline
\hline
\end{array}
\]

\end{document}
2 changes: 2 additions & 0 deletions test/test-syntax/test-array.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ silent edit test-array.tex
if empty($INMAKE) | finish | endif

call assert_true(vimtex#syntax#in('texTabularCol', 10, 17))
call assert_true(vimtex#syntax#in('texTabularCol', 16, 18))
call assert_true(vimtex#syntax#in('texTabularMathdelim', 10, 24))
call assert_true(vimtex#syntax#in('texTabularCol', 30, 16))

call vimtex#test#finished()