Skip to content

Commit cee02dd

Browse files
committed
Fix TypeScript syntax highlighting breaks with template strings
1 parent 76c3a18 commit cee02dd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

syntax/svelte.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,15 @@ silent! syntax clear htmlHead
267267
syntax match javaScriptNumber '\v<-?\d+L?>|0[xX][0-9a-fA-F]+>'
268268
\ containedin=@javascriptSvelteScript display
269269

270+
" TypeScript
271+
" Fix template string `...` breaking syntax highlighting
272+
syntax region typescriptTemplate
273+
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
274+
\ contains=typescriptTemplateSubstitution,typescriptSpecial,@Spell
275+
\ containedin=typescriptObjectLiteral
276+
\ nextgroup=@typescriptSymbols
277+
\ skipwhite skipempty
278+
270279
" html5 data-*
271280
syntax match htmlArg '\v<data(-[.a-z0-9]+)+>' containedin=@HTMLSyntax
272281
"}}}

0 commit comments

Comments
 (0)