Skip to content

Commit 058f139

Browse files
committed
fix(syntax): minor error in minted detection regex
refer: #2142
1 parent a7c30ae commit 058f139

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

autoload/vimtex/syntax/p/minted.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function! s:parse_minted_constructs() abort " {{{1
153153
endif
154154

155155
" Single line minted environments
156-
let l:lang = matchstr(l:line, '\\begin{minted}\%(\s*\[\[^\]]*\]\)\?\s*{\zs\w\+\ze}')
156+
let l:lang = matchstr(l:line, '\\begin{minted}\%(\s*\[[^\]]*\]\)\?\s*{\zs\w\+\ze}')
157157
if !empty(l:lang)
158158
call l:db.register(l:lang)
159159
continue

test/test-syntax/test-minted.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,10 @@
117117
$ ls -l
118118
\end{longss}
119119
120+
\begin{minted}[breaklines]{json}
121+
{
122+
"test": 1
123+
}
124+
\end{minted}
125+
120126
\end{document}

test/test-syntax/test-minted.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ call assert_true(vimtex#syntax#in('texMintedZoneShellsession', 116, 1))
1616
" edit
1717
" call assert_true(vimtex#syntax#in('pythonFunction', 38, 5))
1818

19+
call assert_true(vimtex#syntax#in('texMintedZoneJson', 121, 1))
20+
1921
call vimtex#test#finished()

0 commit comments

Comments
 (0)