mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-10 22:51:52 +08:00
Support oneline block
This commit is contained in:
@@ -114,8 +114,10 @@ function! s:SetSyntax(block, syntax, has_lang)
|
|||||||
else
|
else
|
||||||
let lang = ''
|
let lang = ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let start = '^<'.block.'[^>]*'.lang.'>'
|
let start = '^<'.block.'[^>]*'.lang.'>'
|
||||||
let end = '^</'.block.'>'
|
let end_tag = '</'.block.'>'
|
||||||
|
let end = '^'.end_tag
|
||||||
let syntax_group = s:GetGroupNameForHighlight(syntax)
|
let syntax_group = s:GetGroupNameForHighlight(syntax)
|
||||||
|
|
||||||
execute 'syntax region '.name.' fold '
|
execute 'syntax region '.name.' fold '
|
||||||
@@ -125,6 +127,12 @@ function! s:SetSyntax(block, syntax, has_lang)
|
|||||||
|
|
||||||
execute 'syntax sync match vueSync groupthere '.name.' +'.start.'+'
|
execute 'syntax sync match vueSync groupthere '.name.' +'.start.'+'
|
||||||
execute 'syntax sync match vueSync groupthere NONE +'.end.'+'
|
execute 'syntax sync match vueSync groupthere NONE +'.end.'+'
|
||||||
|
|
||||||
|
" Support block like <script src="..."></script>
|
||||||
|
let oneline = start.end_tag
|
||||||
|
execute 'syntax match '.name.' fold '
|
||||||
|
\.'+'.oneline.'+'
|
||||||
|
\.' keepend contains='.syntax_group.', vueTag'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:SetBlockSyntax(config_syntax)
|
function! s:SetBlockSyntax(config_syntax)
|
||||||
|
|||||||
Reference in New Issue
Block a user