fixed html normal region bug

This commit is contained in:
ManjaroOne666 2017-09-25 00:04:47 +01:00
parent 24ca8806da
commit d8198417ac
2 changed files with 26 additions and 11 deletions

View File

@ -27,8 +27,9 @@ syn case ignore
" mark illegal characters
syn match htmlError "[<>&]"
syn region htmlNormal start=".*" end=".*" contains=TOP,HtmlError,HtmlCommentError,htmlPreProcAttrError
if main_syntax == 'html'
syn region htmlNormal start=".*" end=".*" contains=TOP,HtmlError,HtmlCommentError,htmlPreProcAttrError
endif
syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc keepend
syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc keepend
@ -252,10 +253,16 @@ endif
syn keyword htmlTagName contained noscript
syn keyword htmlSpecialTagName contained script style
if main_syntax != 'java' || exists("java_javascript")
" JAVA SCRIPT
syn include @htmlJavaScript syntax/javascript.vim
unlet b:current_syntax
if main_syntax != "javascript"
syn include @htmlJavaScript syntax/javascript.vim
unlet b:current_syntax
endif
syn region javaScript start=+<script\_[^>]*>+hs=s+1 keepend end=+</script\_[^>]*>+me=s-1 contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc
syn region htmlScriptTag contained start=+<script+hs=s+1 end=+>+ fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
hi def link htmlScriptTag htmlTag
@ -277,6 +284,11 @@ if main_syntax != 'java' || exists("java_javascript")
syn region javaScriptExpression contained start=+&{+ keepend end=+};+ contains=@htmlJavaScript,@htmlPreproc
endif
if main_syntax != 'java' || exists("java_vb")
" VB SCRIPT
syn include @htmlVbScript syntax/vb.vim

View File

@ -3,17 +3,20 @@
" Maintainer: vim-javascript community
" URL: https://github.com/pangloss/vim-javascript
if exists("b:current_syntax")
finish
endif
if !exists("main_syntax")
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
runtime! syntax/html_custom.vim
unlet b:current_syntax
let main_syntax = 'javascript'
endif
runtime! syntax/html_custom.vim
unlet b:current_syntax
" Dollar sign is permitted anywhere in an identifier
if v:version > 704 || v:version == 704 && has('patch1142')