mirror of
https://github.com/leafOfTree/vim-vue-plugin.git
synced 2026-11-02 18:37:34 +08:00
Fix E409 when css syntax isn't loaded
The v-bind() region in style contains cssValue.* groups, which don't exist without css syntax, like when syntax in the config has only script. Opening a file then showed E409 and E475. Add the style highlights only if css syntax is loaded.
This commit is contained in:
3 files changed
+18
No files matched your search
@@ -170,6 +170,10 @@ function! s:HighlightVueTag()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:HighlightVueStyle()
|
function! s:HighlightVueStyle()
|
||||||
|
" Only with css syntax, as contains= below fails without cssValue* groups
|
||||||
|
if !hlexists('cssTagName')
|
||||||
|
return
|
||||||
|
endif
|
||||||
syntax keyword cssPseudoClassId contained deep slotted global
|
syntax keyword cssPseudoClassId contained deep slotted global
|
||||||
syntax region cssFunction contained matchgroup=cssFunctionName
|
syntax region cssFunction contained matchgroup=cssFunctionName
|
||||||
\ start="\<\(v-bind\)\s*(" end=")"
|
\ start="\<\(v-bind\)\s*(" end=")"
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
" Without css syntax, like only script in config
|
||||||
|
let g:vim_vue_plugin_config = {'syntax': {'script': ['javascript']}}
|
||||||
|
let g:test_flatten = 1
|
||||||
|
|
||||||
|
function! Check()
|
||||||
|
call ExpectEqual(GetVueTag(2), 'script', 'tag')
|
||||||
|
endfunction
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return { a: 1 }
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Reference in new issue
Block a user