mirror of
https://github.com/posva/vim-vue.git
synced 2025-12-08 18:34:45 +08:00
Merge pull request #22 from agirorn/fix-broken-unle-of-current_syntax
Only unlet b:current_syntax if it is set.
This commit is contained in:
@@ -30,52 +30,70 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
syntax include @HTML syntax/html.vim
|
syntax include @HTML syntax/html.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region template keepend start=/^<template>/ end=/^<\/template>/ contains=@HTML fold
|
syntax region template keepend start=/^<template>/ end=/^<\/template>/ contains=@HTML fold
|
||||||
|
|
||||||
if s:syntaxes.pug
|
if s:syntaxes.pug
|
||||||
syntax include @PUG syntax/pug.vim
|
syntax include @PUG syntax/pug.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region pug keepend start=/<template lang="[^"]*pug[^"]*">/ end="</template>" contains=@PUG fold
|
syntax region pug keepend start=/<template lang="[^"]*pug[^"]*">/ end="</template>" contains=@PUG fold
|
||||||
syntax region pug keepend start=/<template lang="[^"]*jade[^"]*">/ end="</template>" contains=@PUG fold
|
syntax region pug keepend start=/<template lang="[^"]*jade[^"]*">/ end="</template>" contains=@PUG fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syntax include @JS syntax/javascript.vim
|
syntax include @JS syntax/javascript.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region script keepend start=/<script\( lang="babel"\)\?\( type="text\/babel"\)\?>/ end="</script>" contains=@JS fold
|
syntax region script keepend start=/<script\( lang="babel"\)\?\( type="text\/babel"\)\?>/ end="</script>" contains=@JS fold
|
||||||
|
|
||||||
if s:syntaxes.coffee
|
if s:syntaxes.coffee
|
||||||
syntax include @COFFEE syntax/coffee.vim
|
syntax include @COFFEE syntax/coffee.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
" Matchgroup seems to be necessary for coffee
|
" Matchgroup seems to be necessary for coffee
|
||||||
syntax region coffee keepend matchgroup=Delimiter start="<script lang=\"coffee\">" end="</script>" contains=@COFFEE fold
|
syntax region coffee keepend matchgroup=Delimiter start="<script lang=\"coffee\">" end="</script>" contains=@COFFEE fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
syntax include @CSS syntax/css.vim
|
syntax include @CSS syntax/css.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region style keepend start=/<style\( \+scoped\)\?>/ end="</style>" contains=@CSS fold
|
syntax region style keepend start=/<style\( \+scoped\)\?>/ end="</style>" contains=@CSS fold
|
||||||
|
|
||||||
if s:syntaxes.stylus
|
if s:syntaxes.stylus
|
||||||
syntax include @stylus syntax/stylus.vim
|
syntax include @stylus syntax/stylus.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region stylus keepend start=/<style lang="[^"]*stylus[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@stylus fold
|
syntax region stylus keepend start=/<style lang="[^"]*stylus[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@stylus fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:syntaxes.sass
|
if s:syntaxes.sass
|
||||||
syntax include @sass syntax/sass.vim
|
syntax include @sass syntax/sass.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region sass keepend start=/<style\( \+scoped\)\? lang="[^"]*sass[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@sass fold
|
syntax region sass keepend start=/<style\( \+scoped\)\? lang="[^"]*sass[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@sass fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:syntaxes.scss
|
if s:syntaxes.scss
|
||||||
syntax include @scss syntax/scss.vim
|
syntax include @scss syntax/scss.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region scss keepend start=/<style\( \+scoped\)\? lang="[^"]*scss[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@scss fold
|
syntax region scss keepend start=/<style\( \+scoped\)\? lang="[^"]*scss[^"]*"\( \+scoped\)\?>/ end="</style>" contains=@scss fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if s:syntaxes.less
|
if s:syntaxes.less
|
||||||
syntax include @less syntax/less.vim
|
syntax include @less syntax/less.vim
|
||||||
unlet b:current_syntax
|
if exists("b:current_syntax")
|
||||||
|
unlet b:current_syntax
|
||||||
|
endif
|
||||||
syntax region less keepend matchgroup=PreProc start=/<style\%( \+scoped\)\? lang="less"\%( \+scoped\)\?>/ end="</style>" contains=@less fold
|
syntax region less keepend matchgroup=PreProc start=/<style\%( \+scoped\)\? lang="less"\%( \+scoped\)\?>/ end="</style>" contains=@less fold
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user