Don't sync syntax to a block ending on the same line

A one-line block like <style>p { color: red; }</style> matched the
sync pattern of the block start, so when Vim synced syntax at or after
it, e.g. after jumping to a later line, the following blocks were
taken as inside the style block.
This commit is contained in:
leafOfTree committed 2026-10-19 13:42:16 +00:00
1 parent 04c3fb20ed
commit 1e6923dcd2
1 file changed
+4 -1
+4 -1
View File
@@ -124,7 +124,10 @@ function! s:SetSyntax(block, syntax, has_lang)
\.' end=+'.end.'+'
\.' keepend contains='.syntax_group.', vueTag'
execute 'syntax sync match vueSync groupthere '.name.' +'.start.'+'
" Don't sync to a block ending on the same line, like
" <style>p { color: red; }</style>
let sync_start = start.'\(.*'.end_tag.'\)\@!'
execute 'syntax sync match vueSync groupthere '.name.' +'.sync_start.'+'
execute 'syntax sync match vueSync groupthere NONE +'.end.'+'
" Block like <script src="...">...</script>