mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2025-12-11 07:01:52 +08:00
Improve oneline block syntax
This commit is contained in:
@@ -128,11 +128,11 @@ 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>
|
" Support block like <script src="...">...</script>
|
||||||
let oneline = start.end_tag
|
let oneline = start.'.*'.end_tag
|
||||||
execute 'syntax match '.name.' fold '
|
execute 'syntax match '.name.' fold '
|
||||||
\.'+'.oneline.'+'
|
\.' +'.oneline.'+'
|
||||||
\.' keepend contains='.syntax_group.', vueTag'
|
\.' keepend contains='.syntax_group.', vueTag, vueTagOneline'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:SetBlockSyntax(config_syntax)
|
function! s:SetBlockSyntax(config_syntax)
|
||||||
@@ -155,10 +155,14 @@ function! s:HighlightVueTag()
|
|||||||
syntax region vueTag fold
|
syntax region vueTag fold
|
||||||
\ start=+^<[^/]+ end=+>+ skip=+></+
|
\ start=+^<[^/]+ end=+>+ skip=+></+
|
||||||
\ contained contains=htmlTagN,htmlString,htmlArg
|
\ contained contains=htmlTagN,htmlString,htmlArg
|
||||||
syntax region vueTag
|
syntax region vueTag
|
||||||
\ start=+^</+ end=+>+
|
\ start=+^</+ end=+>+
|
||||||
\ contained contains=htmlTagN,htmlString,htmlArg
|
\ contained contains=htmlTagN,htmlString,htmlArg
|
||||||
|
syntax region vueTagOneline
|
||||||
|
\ start=+</+ end=+>$+
|
||||||
|
\ contained contains=htmlTagN,htmlString,htmlArg
|
||||||
highlight default link vueTag htmlTag
|
highlight default link vueTag htmlTag
|
||||||
|
highlight default link vueTagOneline htmlTag
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:SetIsKeyword()
|
function! s:SetIsKeyword()
|
||||||
|
|||||||
Reference in New Issue
Block a user