mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-11-03 02:47:36 +08:00
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:
1 file changed
+4
-1
+4
-1
@@ -124,7 +124,10 @@ function! s:SetSyntax(block, syntax, has_lang)
|
|||||||
\.' end=+'.end.'+'
|
\.' end=+'.end.'+'
|
||||||
\.' keepend contains='.syntax_group.', vueTag'
|
\.' 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.'+'
|
execute 'syntax sync match vueSync groupthere NONE +'.end.'+'
|
||||||
|
|
||||||
" Block like <script src="...">...</script>
|
" Block like <script src="...">...</script>
|
||||||
|
|||||||
Reference in new issue
Block a user